📄 globalparams.cc
字号:
w = psPaperWidth; globalParamsUnlock; return w;}int GlobalParams::getPSPaperHeight() { int h; globalParamsLock; h = psPaperHeight; globalParamsUnlock; return h;}GBool GlobalParams::getPSDuplex() { GBool d; globalParamsLock; d = psDuplex; globalParamsUnlock; return d;}PSLevel GlobalParams::getPSLevel() { PSLevel level; globalParamsLock; level = psLevel; globalParamsUnlock; return level;}PSFontParam *GlobalParams::getPSFont(GString *fontName) { return (PSFontParam *)psFonts->lookup(fontName);}PSFontParam *GlobalParams::getPSFont16(GString *fontName, GString *collection, int wMode) { PSFontParam *p; int i; p = NULL; if (fontName) { for (i = 0; i < psNamedFonts16->getLength(); ++i) { p = (PSFontParam *)psNamedFonts16->get(i); if (!p->pdfFontName->cmp(fontName) && p->wMode == wMode) { break; } p = NULL; } } if (!p && collection) { for (i = 0; i < psFonts16->getLength(); ++i) { p = (PSFontParam *)psFonts16->get(i); if (!p->pdfFontName->cmp(collection) && p->wMode == wMode) { break; } p = NULL; } } return p;}GBool GlobalParams::getPSEmbedType1() { GBool e; globalParamsLock; e = psEmbedType1; globalParamsUnlock; return e;}GBool GlobalParams::getPSEmbedTrueType() { GBool e; globalParamsLock; e = psEmbedTrueType; globalParamsUnlock; return e;}GBool GlobalParams::getPSEmbedCIDPostScript() { GBool e; globalParamsLock; e = psEmbedCIDPostScript; globalParamsUnlock; return e;}GBool GlobalParams::getPSEmbedCIDTrueType() { GBool e; globalParamsLock; e = psEmbedCIDTrueType; globalParamsUnlock; return e;}GBool GlobalParams::getPSOPI() { GBool opi; globalParamsLock; opi = psOPI; globalParamsUnlock; return opi;}GBool GlobalParams::getPSASCIIHex() { GBool ah; globalParamsLock; ah = psASCIIHex; globalParamsUnlock; return ah;}EndOfLineKind GlobalParams::getTextEOL() { EndOfLineKind eol; globalParamsLock; eol = textEOL; globalParamsUnlock; return eol;}GBool GlobalParams::getTextKeepTinyChars() { GBool tiny; globalParamsLock; tiny = textKeepTinyChars; globalParamsUnlock; return tiny;}GString *GlobalParams::findFontFile(GString *fontName, char *ext1, char *ext2) { GString *dir, *fileName; FILE *f; int i; for (i = 0; i < fontDirs->getLength(); ++i) { dir = (GString *)fontDirs->get(i); if (ext1) { fileName = appendToPath(dir->copy(), fontName->getCString()); fileName->append(ext1); if ((f = fopen(fileName->getCString(), "r"))) { fclose(f); return fileName; } delete fileName; } if (ext2) { fileName = appendToPath(dir->copy(), fontName->getCString()); fileName->append(ext2); if ((f = fopen(fileName->getCString(), "r"))) { fclose(f); return fileName; } delete fileName; } } return NULL;}GString *GlobalParams::getInitialZoom() { GString *s; globalParamsLock; s = initialZoom->copy(); globalParamsUnlock; return s;}FontRastControl GlobalParams::getT1libControl() { FontRastControl c; globalParamsLock; c = t1libControl; globalParamsUnlock; return c;}FontRastControl GlobalParams::getFreeTypeControl() { FontRastControl c; globalParamsLock; c = freetypeControl; globalParamsUnlock; return c;}GBool GlobalParams::getMapNumericCharNames() { GBool map; globalParamsLock; map = mapNumericCharNames; globalParamsUnlock; return map;}GBool GlobalParams::getPrintCommands() { GBool p; globalParamsLock; p = printCommands; globalParamsUnlock; return p;}GBool GlobalParams::getErrQuiet() { GBool q; globalParamsLock; q = errQuiet; globalParamsUnlock; return q;}CharCodeToUnicode *GlobalParams::getCIDToUnicode(GString *collection) { CharCodeToUnicode *ctu; globalParamsLock; ctu = cidToUnicodeCache->getCIDToUnicode(collection); globalParamsUnlock; return ctu;}UnicodeMap *GlobalParams::getUnicodeMap(GString *encodingName) { UnicodeMap *map; globalParamsLock; map = getUnicodeMap2(encodingName); globalParamsUnlock; return map;}UnicodeMap *GlobalParams::getUnicodeMap2(GString *encodingName) { UnicodeMap *map; if ((map = getResidentUnicodeMap(encodingName))) { map->incRefCnt(); } else { map = unicodeMapCache->getUnicodeMap(encodingName); } return map;}CMap *GlobalParams::getCMap(GString *collection, GString *cMapName) { CMap *cMap; globalParamsLock; cMap = cMapCache->getCMap(collection, cMapName); globalParamsUnlock; return cMap;}UnicodeMap *GlobalParams::getTextEncoding() { UnicodeMap *map; globalParamsLock; map = getUnicodeMap2(textEncoding); globalParamsUnlock; return map;}//------------------------------------------------------------------------// functions to set parameters//------------------------------------------------------------------------void GlobalParams::addDisplayFont(DisplayFontParam *param) { DisplayFontParam *old; globalParamsLock; if ((old = (DisplayFontParam *)displayFonts->remove(param->name))) { delete old; } displayFonts->add(param->name, param); globalParamsUnlock;}void GlobalParams::setPSFile(char *file) { globalParamsLock; if (psFile) { delete psFile; } psFile = new GString(file); globalParamsUnlock;}GBool GlobalParams::setPSPaperSize(char *size) { globalParamsLock; if (!strcmp(size, "letter")) { psPaperWidth = 612; psPaperHeight = 792; } else if (!strcmp(size, "legal")) { psPaperWidth = 612; psPaperHeight = 1008; } else if (!strcmp(size, "A4")) { psPaperWidth = 595; psPaperHeight = 842; } else if (!strcmp(size, "A3")) { psPaperWidth = 842; psPaperHeight = 1190; } else { globalParamsUnlock; return gFalse; } globalParamsUnlock; return gTrue;}void GlobalParams::setPSPaperWidth(int width) { globalParamsLock; psPaperWidth = width; globalParamsUnlock;}void GlobalParams::setPSPaperHeight(int height) { globalParamsLock; psPaperHeight = height; globalParamsUnlock;}void GlobalParams::setPSDuplex(GBool duplex) { globalParamsLock; psDuplex = duplex; globalParamsUnlock;}void GlobalParams::setPSLevel(PSLevel level) { globalParamsLock; psLevel = level; globalParamsUnlock;}void GlobalParams::setPSEmbedType1(GBool embed) { globalParamsLock; psEmbedType1 = embed; globalParamsUnlock;}void GlobalParams::setPSEmbedTrueType(GBool embed) { globalParamsLock; psEmbedTrueType = embed; globalParamsUnlock;}void GlobalParams::setPSEmbedCIDPostScript(GBool embed) { globalParamsLock; psEmbedCIDPostScript = embed; globalParamsUnlock;}void GlobalParams::setPSEmbedCIDTrueType(GBool embed) { globalParamsLock; psEmbedCIDTrueType = embed; globalParamsUnlock;}void GlobalParams::setPSOPI(GBool opi) { globalParamsLock; psOPI = opi; globalParamsUnlock;}void GlobalParams::setPSASCIIHex(GBool hex) { globalParamsLock; psASCIIHex = hex; globalParamsUnlock;}void GlobalParams::setTextEncoding(char *encodingName) { globalParamsLock; delete textEncoding; textEncoding = new GString(encodingName); globalParamsUnlock;}GBool GlobalParams::setTextEOL(char *s) { globalParamsLock; if (!strcmp(s, "unix")) { textEOL = eolUnix; } else if (!strcmp(s, "dos")) { textEOL = eolDOS; } else if (!strcmp(s, "mac")) { textEOL = eolMac; } else { globalParamsUnlock; return gFalse; } globalParamsUnlock; return gTrue;}void GlobalParams::setTextKeepTinyChars(GBool keep) { globalParamsLock; textKeepTinyChars = keep; globalParamsUnlock;}void GlobalParams::setInitialZoom(char *s) { globalParamsLock; delete initialZoom; initialZoom = new GString(s); globalParamsUnlock;}GBool GlobalParams::setT1libControl(char *s) { GBool ok; globalParamsLock; ok = setFontRastControl(&t1libControl, s); globalParamsUnlock; return ok;}GBool GlobalParams::setFreeTypeControl(char *s) { GBool ok; globalParamsLock; ok = setFontRastControl(&freetypeControl, s); globalParamsUnlock; return ok;}GBool GlobalParams::setFontRastControl(FontRastControl *val, char *s) { if (!strcmp(s, "none")) { *val = fontRastNone; } else if (!strcmp(s, "plain")) { *val = fontRastPlain; } else if (!strcmp(s, "low")) { *val = fontRastAALow; } else if (!strcmp(s, "high")) { *val = fontRastAAHigh; } else { return gFalse; } return gTrue;}void GlobalParams::setMapNumericCharNames(GBool map) { globalParamsLock; mapNumericCharNames = map; globalParamsUnlock;}void GlobalParams::setPrintCommands(GBool printCommandsA) { globalParamsLock; printCommands = printCommandsA; globalParamsUnlock;}void GlobalParams::setErrQuiet(GBool errQuietA) { globalParamsLock; errQuiet = errQuietA; globalParamsUnlock;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -