Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/T1Font.cc
diff options
context:
space:
mode:
authorMartin Kretzschmar <mkretzschmar@src.gnome.org>2003-03-31 16:45:09 (GMT)
committer Martin Kretzschmar <mkretzschmar@src.gnome.org>2003-03-31 16:45:09 (GMT)
commit28c37dbcf87665a4ccec58bef9ef8ff0697022dd (patch)
tree4fd39a6f8e50717677d56ad0bbb520baa77589f0 /pdf/xpdf/T1Font.cc
parent6112dfe4b45b0305c7a6f61bd8a847f69f892cbb (diff)
Import of Xpdf 2.00 for merge
Diffstat (limited to 'pdf/xpdf/T1Font.cc')
-rw-r--r--pdf/xpdf/T1Font.cc49
1 files changed, 30 insertions, 19 deletions
diff --git a/pdf/xpdf/T1Font.cc b/pdf/xpdf/T1Font.cc
index 7b79d87..9815e49 100644
--- a/pdf/xpdf/T1Font.cc
+++ b/pdf/xpdf/T1Font.cc
@@ -6,14 +6,14 @@
//
//========================================================================
-#ifdef __GNUC__
-#pragma implementation
-#endif
-
#include <aconf.h>
#if HAVE_T1LIB_H
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <math.h>
#include <string.h>
#include <X11/Xlib.h>
@@ -23,6 +23,10 @@
//------------------------------------------------------------------------
+int T1FontEngine::t1libInitCount = 0;
+
+//------------------------------------------------------------------------
+
T1FontEngine::T1FontEngine(Display *displayA, Visual *visualA, int depthA,
Colormap colormapA, GBool aaA, GBool aaHighA):
SFontEngine(displayA, visualA, depthA, colormapA)
@@ -32,30 +36,37 @@ T1FontEngine::T1FontEngine(Display *displayA, Visual *visualA, int depthA,
};
ok = gFalse;
- T1_SetBitmapPad(8);
- if (!T1_InitLib(NO_LOGFILE | IGNORE_CONFIGFILE | IGNORE_FONTDATABASE |
- T1_NO_AFM)) {
- return;
- }
aa = aaA;
aaHigh = aaHighA;
- if (aa) {
- T1_AASetBitsPerPixel(8);
- if (aaHigh) {
- T1_AASetLevel(T1_AA_HIGH);
- T1_AAHSetGrayValues(grayVals);
+ //~ for multithreading: need a mutex here
+ if (t1libInitCount == 0) {
+ T1_SetBitmapPad(8);
+ if (!T1_InitLib(NO_LOGFILE | IGNORE_CONFIGFILE | IGNORE_FONTDATABASE |
+ T1_NO_AFM)) {
+ return;
+ }
+ if (aa) {
+ T1_AASetBitsPerPixel(8);
+ if (aaHigh) {
+ T1_AASetLevel(T1_AA_HIGH);
+ T1_AAHSetGrayValues(grayVals);
+ } else {
+ T1_AASetLevel(T1_AA_LOW);
+ T1_AASetGrayValues(0, 1, 2, 3, 4);
+ }
} else {
- T1_AASetLevel(T1_AA_LOW);
- T1_AASetGrayValues(0, 1, 2, 3, 4);
+ T1_AANSetGrayValues(0, 1);
}
- } else {
- T1_AANSetGrayValues(0, 1);
}
+ ++t1libInitCount;
ok = gTrue;
}
T1FontEngine::~T1FontEngine() {
- T1_CloseLib();
+ //~ for multithreading: need a mutex here
+ if (--t1libInitCount == 0) {
+ T1_CloseLib();
+ }
}
//------------------------------------------------------------------------