@@ -45,6 +45,7 @@ This file is part of the iText (R) project.
4545
4646import com .itextpdf .io .IOException ;
4747import com .itextpdf .io .font .constants .FontStyles ;
48+ import com .itextpdf .io .font .constants .StandardFontFamilies ;
4849import com .itextpdf .io .font .constants .StandardFonts ;
4950import com .itextpdf .io .util .FileUtil ;
5051import com .itextpdf .io .util .MessageFormatUtil ;
@@ -115,7 +116,8 @@ FontProgram getFont(String fontName, int style, boolean cached) throws java.io.I
115116 if (fontName == null )
116117 return null ;
117118 String lowerCaseFontName = fontName .toLowerCase ();
118- List <String > family = fontFamilies .get (lowerCaseFontName );
119+ List <String > family = !lowerCaseFontName .equalsIgnoreCase (StandardFonts .TIMES_ROMAN ) ?
120+ fontFamilies .get (lowerCaseFontName ) : fontFamilies .get (StandardFontFamilies .TIMES .toLowerCase ());
119121 if (family != null ) {
120122 synchronized (family ) {
121123 // some bugs were fixed here by Daniel Marczisovszky
@@ -159,26 +161,25 @@ protected void registerStandardFontFamilies() {
159161 family .add (StandardFonts .COURIER_BOLD );
160162 family .add (StandardFonts .COURIER_OBLIQUE );
161163 family .add (StandardFonts .COURIER_BOLDOBLIQUE );
162- fontFamilies .put (StandardFonts .COURIER .toLowerCase (), family );
164+ fontFamilies .put (StandardFontFamilies .COURIER .toLowerCase (), family );
163165 family = new ArrayList <>();
164166 family .add (StandardFonts .HELVETICA );
165167 family .add (StandardFonts .HELVETICA_BOLD );
166168 family .add (StandardFonts .HELVETICA_OBLIQUE );
167169 family .add (StandardFonts .HELVETICA_BOLDOBLIQUE );
168- fontFamilies .put (StandardFonts .HELVETICA .toLowerCase (), family );
170+ fontFamilies .put (StandardFontFamilies .HELVETICA .toLowerCase (), family );
169171 family = new ArrayList <>();
170172 family .add (StandardFonts .SYMBOL );
171- fontFamilies .put (StandardFonts .SYMBOL .toLowerCase (), family );
173+ fontFamilies .put (StandardFontFamilies .SYMBOL .toLowerCase (), family );
172174 family = new ArrayList <>();
173175 family .add (StandardFonts .TIMES_ROMAN );
174176 family .add (StandardFonts .TIMES_BOLD );
175177 family .add (StandardFonts .TIMES_ITALIC );
176178 family .add (StandardFonts .TIMES_BOLDITALIC );
177- fontFamilies .put (StandardFonts .TIMES .toLowerCase (), family );
178- fontFamilies .put (StandardFonts .TIMES_ROMAN .toLowerCase (), family );
179+ fontFamilies .put (StandardFontFamilies .TIMES .toLowerCase (), family );
179180 family = new ArrayList <>();
180181 family .add (StandardFonts .ZAPFDINGBATS );
181- fontFamilies .put (StandardFonts .ZAPFDINGBATS .toLowerCase (), family );
182+ fontFamilies .put (StandardFontFamilies .ZAPFDINGBATS .toLowerCase (), family );
182183 }
183184
184185 protected FontProgram getFontProgram (String fontName , boolean cached ) throws java .io .IOException {
0 commit comments