@@ -73,7 +73,7 @@ private FontProgramFactory() {
73
73
* Creates a new standard Helvetica font program file.
74
74
*
75
75
* @return a {@link FontProgram} object with Helvetica font description
76
- * @throws java.io.IOException
76
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
77
77
*/
78
78
public static FontProgram createFont () throws java .io .IOException {
79
79
return createFont (StandardFonts .HELVETICA );
@@ -92,7 +92,7 @@ public static FontProgram createFont() throws java.io.IOException {
92
92
*
93
93
* @param fontProgram the name of the font or its location on file
94
94
* @return returns a new {@link FontProgram}. This font program may come from the cache
95
- * @throws java.io.IOException
95
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
96
96
*/
97
97
public static FontProgram createFont (String fontProgram ) throws java .io .IOException {
98
98
return createFont (fontProgram , null , DEFAULT_CACHED );
@@ -112,7 +112,7 @@ public static FontProgram createFont(String fontProgram) throws java.io.IOExcept
112
112
* @param fontProgram the name of the font or its location on file
113
113
* @param cached whether to to cache this font program after it has been loaded
114
114
* @return returns a new {@link FontProgram}. This font program may come from the cache
115
- * @throws java.io.IOException
115
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
116
116
*/
117
117
public static FontProgram createFont (String fontProgram , boolean cached ) throws java .io .IOException {
118
118
return createFont (fontProgram , null , cached );
@@ -131,7 +131,7 @@ public static FontProgram createFont(String fontProgram, boolean cached) throws
131
131
*
132
132
* @param fontProgram the byte contents of the font program
133
133
* @return returns a new {@link FontProgram}. This font program may come from the cache
134
- * @throws java.io.IOException
134
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
135
135
*/
136
136
public static FontProgram createFont (byte [] fontProgram ) throws java .io .IOException {
137
137
return createFont (null , fontProgram , DEFAULT_CACHED );
@@ -151,7 +151,7 @@ public static FontProgram createFont(byte[] fontProgram) throws java.io.IOExcept
151
151
* @param fontProgram the byte contents of the font program
152
152
* @param cached whether to to cache this font program
153
153
* @return returns a new {@link FontProgram}. This font program may come from the cache
154
- * @throws java.io.IOException
154
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
155
155
*/
156
156
public static FontProgram createFont (byte [] fontProgram , boolean cached ) throws java .io .IOException {
157
157
return createFont (null , fontProgram , cached );
@@ -256,7 +256,7 @@ private static FontProgram createFont(String name, byte[] fontProgram, boolean c
256
256
* @param afm the contents of the AFM or PFM metrics file
257
257
* @param pfb the contents of the PFB file
258
258
* @return created {@link FontProgram} instance
259
- * @throws java.io.IOException
259
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
260
260
*/
261
261
public static FontProgram createType1Font (byte [] afm , byte [] pfb ) throws java .io .IOException {
262
262
return createType1Font (afm , pfb , DEFAULT_CACHED );
@@ -269,7 +269,7 @@ public static FontProgram createType1Font(byte[] afm, byte[] pfb) throws java.io
269
269
* @param pfb the contents of the PFB file
270
270
* @param cached specifies whether to cache the created {@link FontProgram} or not
271
271
* @return created {@link FontProgram} instance
272
- * @throws java.io.IOException
272
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
273
273
*/
274
274
public static FontProgram createType1Font (byte [] afm , byte [] pfb , boolean cached ) throws java .io .IOException {
275
275
return createType1Font (null , null , afm , pfb , cached );
@@ -281,7 +281,7 @@ public static FontProgram createType1Font(byte[] afm, byte[] pfb, boolean cached
281
281
* @param metricsPath path to the AFM or PFM metrics file
282
282
* @param binaryPath path to the contents of the PFB file
283
283
* @return created {@link FontProgram} instance
284
- * @throws java.io.IOException
284
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
285
285
*/
286
286
public static FontProgram createType1Font (String metricsPath , String binaryPath ) throws java .io .IOException {
287
287
return createType1Font (metricsPath , binaryPath , DEFAULT_CACHED );
@@ -294,7 +294,7 @@ public static FontProgram createType1Font(String metricsPath, String binaryPath)
294
294
* @param binaryPath path to the contents of the PFB file
295
295
* @param cached specifies whether to cache the created {@link FontProgram} or not
296
296
* @return created {@link FontProgram} instance
297
- * @throws java.io.IOException
297
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
298
298
*/
299
299
public static FontProgram createType1Font (String metricsPath , String binaryPath , boolean cached ) throws java .io .IOException {
300
300
return createType1Font (metricsPath , binaryPath , null , null , cached );
@@ -309,7 +309,7 @@ public static FontProgram createType1Font(String metricsPath, String binaryPath,
309
309
* the cache if new, false if the font is always created new
310
310
* @return returns a new {@link FontProgram} instance. This font may come from the cache but only if cached
311
311
* is true, otherwise it will always be created new
312
- * @throws java.io.IOException
312
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
313
313
*/
314
314
public static FontProgram createFont (String ttc , int ttcIndex , boolean cached ) throws java .io .IOException {
315
315
FontCacheKey fontCacheKey = FontCacheKey .create (ttc , ttcIndex );
@@ -332,7 +332,7 @@ public static FontProgram createFont(String ttc, int ttcIndex, boolean cached) t
332
332
* the cache if new, false if the font is always created new
333
333
* @return returns a new {@link FontProgram} instance. This font may come from the cache but only if cached
334
334
* is true, otherwise it will always be created new
335
- * @throws java.io.IOException
335
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
336
336
*/
337
337
public static FontProgram createFont (byte [] ttc , int ttcIndex , boolean cached ) throws java .io .IOException {
338
338
FontCacheKey fontKey = FontCacheKey .create (ttc , ttcIndex );
@@ -356,7 +356,7 @@ public static FontProgram createFont(byte[] ttc, int ttcIndex, boolean cached) t
356
356
* {@link FontStyles#BOLDITALIC}, {@link FontStyles#UNDEFINED}
357
357
* @param cached whether to try to get the font program from cache
358
358
* @return created {@link FontProgram}
359
- * @throws java.io.IOException
359
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
360
360
*/
361
361
public static FontProgram createRegisteredFont (String fontName , int style , boolean cached ) throws java .io .IOException {
362
362
return fontRegisterProvider .getFont (fontName , style , cached );
@@ -371,7 +371,7 @@ public static FontProgram createRegisteredFont(String fontName, int style, boole
371
371
* See {@link FontStyles#BOLD}, {@link FontStyles#ITALIC}, {@link FontStyles#NORMAL},
372
372
* {@link FontStyles#BOLDITALIC}, {@link FontStyles#UNDEFINED}
373
373
* @return created {@link FontProgram}
374
- * @throws java.io.IOException
374
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file
375
375
*/
376
376
public static FontProgram createRegisteredFont (String fontName , int style ) throws java .io .IOException {
377
377
return fontRegisterProvider .getFont (fontName , style );
@@ -383,7 +383,7 @@ public static FontProgram createRegisteredFont(String fontName, int style) throw
383
383
* @param fontName either a font alias, if the font file has been registered with an alias,
384
384
* or just a font name otherwise
385
385
* @return created {@link FontProgram}
386
- * @throws java.io.IOException
386
+ * @throws java.io.IOException exception is thrown in case an I/O error occurs when reading the file2
387
387
*/
388
388
public static FontProgram createRegisteredFont (String fontName ) throws java .io .IOException {
389
389
return fontRegisterProvider .getFont (fontName , FontStyles .UNDEFINED );
@@ -496,6 +496,9 @@ private static FontCacheKey createFontCacheKey(String name, byte[] fontProgram)
496
496
497
497
public static void clearRegisteredFonts () { fontRegisterProvider .clearRegisteredFonts (); }
498
498
499
+ /**
500
+ * Clears registered font cache
501
+ */
499
502
public static void clearRegisteredFontFamilies () { fontRegisterProvider .clearRegisteredFontFamilies (); }
500
503
501
504
static byte [] readFontBytesFromPath (String path ) throws java .io .IOException {
0 commit comments