37
37
* more fonts which is extremely important on Linux systems.</p>
38
38
* <p>It is possible to specify other directories to search for fonts via the
39
39
* readSystemFonts methods extraFontPaths parameter {@link #readSystemFonts}.
40
- * Reading all of an operating systems font's can be time consuming. To help
40
+ * Reading all of an operating systems font's can be time- consuming. To help
41
41
* speed up this process the method getFontProperties exports font data via a
42
42
* Properties object. The font Properties object can then be saved to disk or
43
43
* be read back into the FontManager via the setFontProperties method. </p>
@@ -68,19 +68,29 @@ public class FontManager {
68
68
{"Bookman-Light" , "URWBookmanL-Ligh" , "Arial" },
69
69
{"Bookman-LightItalic" , "URWBookmanL-LighItal" , "Arial" },
70
70
{"Courier" , "NimbusMonL-Regu" , "Nimbus Mono L" , "CourierNew" , "CourierNewPSMT" },
71
- {"Courier-Oblique" , "NimbusMonL-ReguObli" , "Nimbus Mono L" , "Courier,Italic" , "CourierNew-Italic" , "CourierNew,Italic" , "CourierNewPS-ItalicMT" },
72
- {"Courier-Bold" , "NimbusMonL-Bold" , "Nimbus Mono L" , "Courier,Bold" , "CourierNew,Bold" , "CourierNew-Bold" , "CourierNewPS-BoldMT" },
73
- {"Courier-BoldOblique" , "NimbusMonL-BoldObli" , "Nimbus Mono L" , "Courier,BoldItalic" , "CourierNew-BoldItalic" , "CourierNew,BoldItalic" , "CourierNewPS-BoldItalicMT" },
71
+ {"Courier-Oblique" , "NimbusMonL-ReguObli" , "Nimbus Mono L" , "Courier,Italic" , "CourierNew-Italic"
72
+ , "CourierNew,Italic" , "CourierNewPS-ItalicMT" },
73
+ {"Courier-Bold" , "NimbusMonL-Bold" , "Nimbus Mono L" , "Courier,Bold" , "CourierNew,Bold" ,
74
+ "CourierNew-Bold" , "CourierNewPS-BoldMT" },
75
+ {"Courier-BoldOblique" , "NimbusMonL-BoldObli" , "Nimbus Mono L" , "Courier,BoldItalic" , "CourierNew" +
76
+ "-BoldItalic" , "CourierNew,BoldItalic" , "CourierNewPS-BoldItalicMT" },
74
77
{"AvantGarde-Book" , "URWGothicL-Book" , "Arial" },
75
78
{"AvantGarde-BookOblique" , "URWGothicL-BookObli" , "Arial" },
76
79
{"AvantGarde-Demi" , "URWGothicL-Demi" , "Arial" },
77
80
{"AvantGarde-DemiOblique" , "URWGothicL-DemiObli" , "Arial" },
78
81
{"Helvetica" , "Helvetica" , "Arial" , "ArialMT" , "NimbusSanL-Regu" , "Nimbus Sans L" },
79
- {"Helvetica-Oblique" , "NimbusSanL-ReguItal" , "Nimbus Sans L" , "Helvetica,Italic" , "Helvetica-Italic" , "Arial,Italic" , "Arial-Italic" , "Arial-ItalicMT" },
80
- {"Helvetica-Bold" , "Helvetica,Bold" , "Arial,Bold" , "Arial-Bold" , "Arial-BoldMT" , "NimbusSanL-Bold" , "Nimbus Sans L" },
81
- {"Helvetica-BoldOblique" , "NimbusSanL-BoldItal" , "Helvetica-BlackOblique" , "Nimbus Sans L" , "Helvetica,BoldItalic" , "Helvetica-BoldItalic" , "Arial,BoldItalic" , "Arial-BoldItalic" , "Arial-BoldItalicMT" },
82
- {"Helvetica-Black" , "Helvetica,Bold" , "Arial,Bold" , "Arial-Bold" , "Arial-BoldMT" , "NimbusSanL-Bold" , "Nimbus Sans L" },
83
- {"Helvetica-BlackOblique" , "NimbusSanL-BoldItal" , "Helvetica-BlackOblique" , "Nimbus Sans L" , "Helvetica,BoldItalic" , "Helvetica-BoldItalic" , "Arial,BoldItalic" , "Arial-BoldItalic" , "Arial-BoldItalicMT" },
82
+ {"Helvetica-Oblique" , "NimbusSanL-ReguItal" , "Nimbus Sans L" , "Helvetica,Italic" , "Helvetica" +
83
+ "-Italic" , "Arial,Italic" , "Arial-Italic" , "Arial-ItalicMT" },
84
+ {"Helvetica-Bold" , "Helvetica,Bold" , "Arial,Bold" , "Arial-Bold" , "Arial-BoldMT" , "NimbusSanL-Bold"
85
+ , "Nimbus Sans L" },
86
+ {"Helvetica-BoldOblique" , "NimbusSanL-BoldItal" , "Helvetica-BlackOblique" , "Nimbus Sans L" ,
87
+ "Helvetica,BoldItalic" , "Helvetica-BoldItalic" , "Arial,BoldItalic" , "Arial-BoldItalic" ,
88
+ "Arial-BoldItalicMT" },
89
+ {"Helvetica-Black" , "Helvetica,Bold" , "Arial,Bold" , "Arial-Bold" , "Arial-BoldMT" , "NimbusSanL" +
90
+ "-Bold" , "Nimbus Sans L" },
91
+ {"Helvetica-BlackOblique" , "NimbusSanL-BoldItal" , "Helvetica-BlackOblique" , "Nimbus Sans L" ,
92
+ "Helvetica,BoldItalic" , "Helvetica-BoldItalic" , "Arial,BoldItalic" , "Arial-BoldItalic" ,
93
+ "Arial-BoldItalicMT" },
84
94
{"Helvetica-Narrow" , "NimbusSanL-ReguCond" , "Nimbus Sans L" },
85
95
{"Helvetica-Narrow-Oblique" , "NimbusSanL-ReguCondItal" , "Nimbus Sans L" },
86
96
{"Helvetica-Narrow-Bold" , "NimbusSanL-BoldCond" , "Nimbus Sans L" },
@@ -97,10 +107,14 @@ public class FontManager {
97
107
{"NewCenturySchlbk-Italic" , "CenturySchL-Ital" , "Arial" },
98
108
{"NewCenturySchlbk-Bold" , "CenturySchL-Bold" , "Arial" },
99
109
{"NewCenturySchlbk-BoldItalic" , "CenturySchL-BoldItal" , "Arial" },
100
- {"Times-Roman" , "NimbusRomNo9L-Regu" , "Nimbus Roman No9 L" , "TimesNewRoman" , "TimesNewRomanPSMT" , "TimesNewRomanPS" },
101
- {"Times-Italic" , "NimbusRomNo9L-ReguItal" , "Nimbus Roman No9 L" , "TimesNewRoman,Italic" , "TimesNewRoman-Italic" , "TimesNewRomanPS-Italic" , "TimesNewRomanPS-ItalicMT" },
102
- {"Times-Bold" , "NimbusRomNo9L-Medi" , "Nimbus Roman No9 L" , "TimesNewRoman,Bold" , "TimesNewRoman-Bold" , "TimesNewRomanPS-Bold" , "TimesNewRomanPS-BoldMT" },
103
- {"Times-BoldItalic" , "NimbusRomNo9L-MediItal" , "Nimbus Roman No9 L" , "TimesNewRoman,BoldItalic" , "TimesNewRoman-BoldItalic" , "TimesNewRomanPS-BoldItalic" , "TimesNewRomanPS-BoldItalicMT" },
110
+ {"Times-Roman" , "NimbusRomNo9L-Regu" , "Nimbus Roman No9 L" , "TimesNewRoman" , "TimesNewRomanPSMT" ,
111
+ "TimesNewRomanPS" },
112
+ {"Times-Italic" , "NimbusRomNo9L-ReguItal" , "Nimbus Roman No9 L" , "TimesNewRoman,Italic" ,
113
+ "TimesNewRoman-Italic" , "TimesNewRomanPS-Italic" , "TimesNewRomanPS-ItalicMT" },
114
+ {"Times-Bold" , "NimbusRomNo9L-Medi" , "Nimbus Roman No9 L" , "TimesNewRoman,Bold" , "TimesNewRoman" +
115
+ "-Bold" , "TimesNewRomanPS-Bold" , "TimesNewRomanPS-BoldMT" },
116
+ {"Times-BoldItalic" , "NimbusRomNo9L-MediItal" , "Nimbus Roman No9 L" , "TimesNewRoman,BoldItalic" ,
117
+ "TimesNewRoman-BoldItalic" , "TimesNewRomanPS-BoldItalic" , "TimesNewRomanPS-BoldItalicMT" },
104
118
{"Symbol" , "StandardSymL" , "Standard Symbols L" },
105
119
{"ZapfChancery-MediumItalic" , "URWChanceryL-MediItal" , "Arial" },
106
120
{"ZapfDingbats" , "Dingbats" , "Zapf-Dingbats" }
@@ -191,11 +205,12 @@ public class FontManager {
191
205
"opensymbol" ,
192
206
"starsymbol" ,
193
207
"symbolmt" ,
208
+ "notosanssymbols" ,
194
209
"arial-black" ,
195
210
"arial-blackitalic" ,
196
211
"new" ,
197
212
// mapping issue with standard ascii, not sure why, TimesNewRomanPSMT is ok.
198
- "timesnewromanps" ,
213
+ // "timesnewromanps",
199
214
// doesn't seem to the correct cid mapping otf version anyways.
200
215
"kozminpro-regular"
201
216
);
@@ -344,7 +359,8 @@ public void clearFontList() {
344
359
}
345
360
346
361
/**
347
- * <p>Reads font from the specified array of file paths only, no . This font data is used to substitute fonts which are not
362
+ * <p>Reads font from the specified array of file paths only, no . This font data is used to substitute fonts
363
+ * which are not
348
364
* embedded inside a PDF document.</p>
349
365
*
350
366
* @param extraFontPaths array String object where each entry represents
@@ -585,7 +601,7 @@ private FontFile getAsianInstance(List<Object[]> fontList, String name, String[]
585
601
fontList = new ArrayList <>(150 );
586
602
}
587
603
588
- FontFile font = null ;
604
+ FontFile font ;
589
605
if (list != null ) {
590
606
// search for know list of fonts
591
607
for (int i = list .length - 1 ; i >= 0 ; i --) {
@@ -796,7 +812,7 @@ private FontFile findFont(List<Object[]> fontList, String fontName, int flags) {
796
812
for (int i = fontList .size () - 1 ; i >= 0 ; i --) {
797
813
fontData = fontList .get (i );
798
814
baseName = (String ) fontData [FONT_NAME ];
799
- familyName = (String ) fontData [FONT_FAMILY ];
815
+ familyName = (( String ) fontData [FONT_FAMILY ]). replaceAll ( "(?i)(psmt|ps|mt)$" , "" ) ;
800
816
path = (String ) fontData [FONT_PATH ];
801
817
if (logger .isLoggable (Level .FINEST )) {
802
818
logger .finest (baseName + " : " + familyName + " : " + name );
0 commit comments