1 | /* | |
2 | * $Id: TrueTypeFont.java 4066 2009-09-19 12:44:47Z psoares33 $ | |
3 | * | |
4 | * Copyright 2001-2006 Paulo Soares | |
5 | * | |
6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 | |
7 | * (the "License"); you may not use this file except in compliance with the License. | |
8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ | |
9 | * | |
10 | * Software distributed under the License is distributed on an "AS IS" basis, | |
11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
12 | * for the specific language governing rights and limitations under the License. | |
13 | * | |
14 | * The Original Code is 'iText, a free JAVA-PDF library'. | |
15 | * | |
16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by | |
17 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. | |
18 | * All Rights Reserved. | |
19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer | |
20 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. | |
21 | * | |
22 | * Contributor(s): all the names of the contributors are added in the source code | |
23 | * where applicable. | |
24 | * | |
25 | * Alternatively, the contents of this file may be used under the terms of the | |
26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the | |
27 | * provisions of LGPL are applicable instead of those above. If you wish to | |
28 | * allow use of your version of this file only under the terms of the LGPL | |
29 | * License and not to allow others to use your version of this file under | |
30 | * the MPL, indicate your decision by deleting the provisions above and | |
31 | * replace them with the notice and other provisions required by the LGPL. | |
32 | * If you do not delete the provisions above, a recipient may use your version | |
33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. | |
34 | * | |
35 | * This library is free software; you can redistribute it and/or modify it | |
36 | * under the terms of the MPL as stated above or under the terms of the GNU | |
37 | * Library General Public License as published by the Free Software Foundation; | |
38 | * either version 2 of the License, or any later version. | |
39 | * | |
40 | * This library is distributed in the hope that it will be useful, but WITHOUT | |
41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more | |
43 | * details. | |
44 | * | |
45 | * If you didn't download this code from the following link, you should check if | |
46 | * you aren't using an obsolete version: | |
47 | * http://www.lowagie.com/iText/ | |
48 | */ | |
49 | ||
50 | package com.lowagie.text.pdf; | |
51 | ||
52 | import java.io.File; | |
53 | import java.io.IOException; | |
54 | import java.util.ArrayList; | |
55 | import java.util.HashMap; | |
56 | import java.util.Map; | |
57 | import com.lowagie.text.error_messages.MessageLocalization; | |
58 | ||
59 | import com.lowagie.text.Document; | |
60 | import com.lowagie.text.DocumentException; | |
61 | import com.lowagie.text.ExceptionConverter; | |
62 | ||
63 | ||
64 | /** Reads a Truetype font | |
65 | * | |
66 | * @author Paulo Soares (psoares@consiste.pt) | |
67 | */ | |
68 | class TrueTypeFont extends BaseFont { | |
69 | ||
70 | /** | |
71 | * The code pages possible for a True Type font. | |
72 | */ | |
73 | static final String[] codePages = { | |
74 | "1252 Latin 1", | |
75 | "1250 Latin 2: Eastern Europe", | |
76 | "1251 Cyrillic", | |
77 | "1253 Greek", | |
78 | "1254 Turkish", | |
79 | "1255 Hebrew", | |
80 | "1256 Arabic", | |
81 | "1257 Windows Baltic", | |
82 | "1258 Vietnamese", | |
83 | null, | |
84 | null, | |
85 | null, | |
86 | null, | |
87 | null, | |
88 | null, | |
89 | null, | |
90 | "874 Thai", | |
91 | "932 JIS/Japan", | |
92 | "936 Chinese: Simplified chars--PRC and Singapore", | |
93 | "949 Korean Wansung", | |
94 | "950 Chinese: Traditional chars--Taiwan and Hong Kong", | |
95 | "1361 Korean Johab", | |
96 | null, | |
97 | null, | |
98 | null, | |
99 | null, | |
100 | null, | |
101 | null, | |
102 | null, | |
103 | "Macintosh Character Set (US Roman)", | |
104 | "OEM Character Set", | |
105 | "Symbol Character Set", | |
106 | null, | |
107 | null, | |
108 | null, | |
109 | null, | |
110 | null, | |
111 | null, | |
112 | null, | |
113 | null, | |
114 | null, | |
115 | null, | |
116 | null, | |
117 | null, | |
118 | null, | |
119 | null, | |
120 | null, | |
121 | null, | |
122 | "869 IBM Greek", | |
123 | "866 MS-DOS Russian", | |
124 | "865 MS-DOS Nordic", | |
125 | "864 Arabic", | |
126 | "863 MS-DOS Canadian French", | |
127 | "862 Hebrew", | |
128 | "861 MS-DOS Icelandic", | |
129 | "860 MS-DOS Portuguese", | |
130 | "857 IBM Turkish", | |
131 | "855 IBM Cyrillic; primarily Russian", | |
132 | "852 Latin 2", | |
133 | "775 MS-DOS Baltic", | |
134 | "737 Greek; former 437 G", | |
135 | "708 Arabic; ASMO 708", | |
136 | "850 WE/Latin 1", | |
137 | "437 US"}; | |
138 | | |
139 | protected boolean justNames = false; | |
140 | /** Contains the location of the several tables. The key is the name of | |
141 | * the table and the value is an <CODE>int[2]</CODE> where position 0 | |
142 | * is the offset from the start of the file and position 1 is the length | |
143 | * of the table. | |
144 | */ | |
145 | protected HashMap tables; | |
146 | /** The file in use. | |
147 | */ | |
148 | protected RandomAccessFileOrArray rf; | |
149 | /** The file name. | |
150 | */ | |
151 | protected String fileName; | |
152 | | |
153 | protected boolean cff = false; | |
154 | | |
155 | protected int cffOffset; | |
156 | | |
157 | protected int cffLength; | |
158 | | |
159 | /** The offset from the start of the file to the table directory. | |
160 | * It is 0 for TTF and may vary for TTC depending on the chosen font. | |
161 | */ | |
162 | protected int directoryOffset; | |
163 | /** The index for the TTC font. It is an empty <CODE>String</CODE> for a | |
164 | * TTF file. | |
165 | */ | |
166 | protected String ttcIndex; | |
167 | /** The style modifier */ | |
168 | protected String style = ""; | |
169 | /** The content of table 'head'. | |
170 | */ | |
171 | protected FontHeader head = new FontHeader(); | |
172 | /** The content of table 'hhea'. | |
173 | */ | |
174 | protected HorizontalHeader hhea = new HorizontalHeader(); | |
175 | /** The content of table 'OS/2'. | |
176 | */ | |
177 | protected WindowsMetrics os_2 = new WindowsMetrics(); | |
178 | /** | |
179 | * The width of the glyphs. This is essentially the content of table | |
180 | * 'hmtx' normalized to 1000 units. | |
181 | */ | |
182 | protected int[] GlyphWidths; | |
183 | ||
184 | protected int[][] bboxes; | |
185 | /** The map containing the code information for the table 'cmap', encoding 1.0. | |
186 | * The key is the code and the value is an <CODE>int[2]</CODE> where position 0 | |
187 | * is the glyph number and position 1 is the glyph width normalized to 1000 | |
188 | * units. | |
189 | */ | |
190 | protected HashMap cmap10; | |
191 | /** The map containing the code information for the table 'cmap', encoding 3.1 | |
192 | * in Unicode. | |
193 | * <P> | |
194 | * The key is the code and the value is an <CODE>int</CODE>[2] where position 0 | |
195 | * is the glyph number and position 1 is the glyph width normalized to 1000 | |
196 | * units. | |
197 | */ | |
198 | protected HashMap cmap31; | |
199 | ||
200 | protected HashMap cmapExt; | |
201 | ||
202 | /** The map containing the kerning information. It represents the content of | |
203 | * table 'kern'. The key is an <CODE>Integer</CODE> where the top 16 bits | |
204 | * are the glyph number for the first character and the lower 16 bits are the | |
205 | * glyph number for the second character. The value is the amount of kerning in | |
206 | * normalized 1000 units as an <CODE>Integer</CODE>. This value is usually negative. | |
207 | */ | |
208 | protected IntHashtable kerning = new IntHashtable(); | |
209 | /** | |
210 | * The font name. | |
211 | * This name is usually extracted from the table 'name' with | |
212 | * the 'Name ID' 6. | |
213 | */ | |
214 | protected String fontName; | |
215 | ||
216 | /** | |
217 | * The full name of the font | |
218 | */ | |
219 | protected String[][] fullName; | |
220 | ||
221 | /** | |
222 | * All the names of the Names-Table | |
223 | */ | |
224 | protected String[][] allNameEntries; | |
225 | ||
226 | /** | |
227 | * The family name of the font | |
228 | */ | |
229 | protected String[][] familyName; | |
230 | /** The italic angle. It is usually extracted from the 'post' table or in it's | |
231 | * absence with the code: | |
232 | * <P> | |
233 | * <PRE> | |
234 | * -Math.atan2(hhea.caretSlopeRun, hhea.caretSlopeRise) * 180 / Math.PI | |
235 | * </PRE> | |
236 | */ | |
237 | protected double italicAngle; | |
238 | /** <CODE>true</CODE> if all the glyphs have the same width. | |
239 | */ | |
240 | protected boolean isFixedPitch = false; | |
241 | | |
242 | protected int underlinePosition; | |
243 | | |
244 | protected int underlineThickness; | |
245 | | |
246 | /** The components of table 'head'. | |
247 | */ | |
248 | protected static class FontHeader { | |
249 | /** A variable. */ | |
250 | int flags; | |
251 | /** A variable. */ | |
252 | int unitsPerEm; | |
253 | /** A variable. */ | |
254 | short xMin; | |
255 | /** A variable. */ | |
256 | short yMin; | |
257 | /** A variable. */ | |
258 | short xMax; | |
259 | /** A variable. */ | |
260 | short yMax; | |
261 | /** A variable. */ | |
262 | int macStyle; | |
263 | } | |
264 | | |
265 | /** The components of table 'hhea'. | |
266 | */ | |
267 | protected static class HorizontalHeader { | |
268 | /** A variable. */ | |
269 | short Ascender; | |
270 | /** A variable. */ | |
271 | short Descender; | |
272 | /** A variable. */ | |
273 | short LineGap; | |
274 | /** A variable. */ | |
275 | int advanceWidthMax; | |
276 | /** A variable. */ | |
277 | short minLeftSideBearing; | |
278 | /** A variable. */ | |
279 | short minRightSideBearing; | |
280 | /** A variable. */ | |
281 | short xMaxExtent; | |
282 | /** A variable. */ | |
283 | short caretSlopeRise; | |
284 | /** A variable. */ | |
285 | short caretSlopeRun; | |
286 | /** A variable. */ | |
287 | int numberOfHMetrics; | |
288 | } | |
289 | | |
290 | /** The components of table 'OS/2'. | |
291 | */ | |
292 | protected static class WindowsMetrics { | |
293 | /** A variable. */ | |
294 | short xAvgCharWidth; | |
295 | /** A variable. */ | |
296 | int usWeightClass; | |
297 | /** A variable. */ | |
298 | int usWidthClass; | |
299 | /** A variable. */ | |
300 | short fsType; | |
301 | /** A variable. */ | |
302 | short ySubscriptXSize; | |
303 | /** A variable. */ | |
304 | short ySubscriptYSize; | |
305 | /** A variable. */ | |
306 | short ySubscriptXOffset; | |
307 | /** A variable. */ | |
308 | short ySubscriptYOffset; | |
309 | /** A variable. */ | |
310 | short ySuperscriptXSize; | |
311 | /** A variable. */ | |
312 | short ySuperscriptYSize; | |
313 | /** A variable. */ | |
314 | short ySuperscriptXOffset; | |
315 | /** A variable. */ | |
316 | short ySuperscriptYOffset; | |
317 | /** A variable. */ | |
318 | short yStrikeoutSize; | |
319 | /** A variable. */ | |
320 | short yStrikeoutPosition; | |
321 | /** A variable. */ | |
322 | short sFamilyClass; | |
323 | /** | |
324 | * A variable. | |
325 | */ | |
326 | byte[] panose = new byte[10]; | |
327 | /** | |
328 | * A variable. | |
329 | */ | |
330 | byte[] achVendID = new byte[4]; | |
331 | /** A variable. */ | |
332 | int fsSelection; | |
333 | /** A variable. */ | |
334 | int usFirstCharIndex; | |
335 | /** A variable. */ | |
336 | int usLastCharIndex; | |
337 | /** A variable. */ | |
338 | short sTypoAscender; | |
339 | /** A variable. */ | |
340 | short sTypoDescender; | |
341 | /** A variable. */ | |
342 | short sTypoLineGap; | |
343 | /** A variable. */ | |
344 | int usWinAscent; | |
345 | /** A variable. */ | |
346 | int usWinDescent; | |
347 | /** A variable. */ | |
348 | int ulCodePageRange1; | |
349 | /** A variable. */ | |
350 | int ulCodePageRange2; | |
351 | /** A variable. */ | |
352 | int sCapHeight; | |
353 | } | |
354 | | |
355 | /** This constructor is present to allow extending the class. | |
356 | */ | |
357 | protected TrueTypeFont() { | |
358 | } | |
359 | | |
360 | /** Creates a new TrueType font. | |
361 | * @param ttFile the location of the font on file. The file must end in '.ttf' or | |
362 | * '.ttc' but can have modifiers after the name | |
363 | * @param enc the encoding to be applied to this font | |
364 | * @param emb true if the font is to be embedded in the PDF | |
365 | * @param ttfAfm the font as a <CODE>byte</CODE> array | |
366 | * @throws DocumentException the font is invalid | |
367 | * @throws IOException the font file could not be read | |
368 | * @since 2.1.5 | |
369 | */ | |
370 | TrueTypeFont(String ttFile, String enc, boolean emb, byte[] ttfAfm, boolean justNames, boolean forceRead) throws DocumentException, IOException { | |
371 | this.justNames = justNames; | |
372 | String nameBase = getBaseName(ttFile); | |
373 | String ttcName = getTTCName(nameBase); | |
374 |
2
1. 2. |
if (nameBase.length() < ttFile.length()) { |
375 | style = ttFile.substring(nameBase.length()); | |
376 | } | |
377 | encoding = enc; | |
378 | embedded = emb; | |
379 | fileName = ttcName; | |
380 | fontType = FONT_TYPE_TT; | |
381 | ttcIndex = ""; | |
382 |
2
1. 2. |
if (ttcName.length() < nameBase.length()) |
383 |
1
1. |
ttcIndex = nameBase.substring(ttcName.length() + 1); |
384 |
3
1. 2. 3. |
if (fileName.toLowerCase().endsWith(".ttf") || fileName.toLowerCase().endsWith(".otf") || fileName.toLowerCase().endsWith(".ttc")) { |
385 |
1
1. |
process(ttfAfm, forceRead); |
386 |
3
1. 2. 3. |
if (!justNames && embedded && os_2.fsType == 2) |
387 | throw new DocumentException(MessageLocalization.getComposedMessage("1.cannot.be.embedded.due.to.licensing.restrictions", fileName + style)); | |
388 | } | |
389 | else | |
390 | throw new DocumentException(MessageLocalization.getComposedMessage("1.is.not.a.ttf.otf.or.ttc.font.file", fileName + style)); | |
391 |
1
1. |
if (!encoding.startsWith("#")) |
392 | PdfEncodings.convertToBytes(" ", enc); // check if the encoding exists | |
393 |
1
1. |
createEncoding(); |
394 | } | |
395 | | |
396 | /** Gets the name from a composed TTC file name. | |
397 | * If I have for input "myfont.ttc,2" the return will | |
398 | * be "myfont.ttc". | |
399 | * @param name the full name | |
400 | * @return the simple file name | |
401 | */ | |
402 | protected static String getTTCName(String name) { | |
403 | int idx = name.toLowerCase().indexOf(".ttc,"); | |
404 |
2
1. getTTCName : changed conditional boundary → NO_COVERAGE 2. getTTCName : negated conditional → NO_COVERAGE |
if (idx < 0) |
405 |
1
1. getTTCName : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getTTCName to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return name; |
406 | else | |
407 |
2
1. getTTCName : Replaced integer addition with subtraction → NO_COVERAGE 2. getTTCName : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getTTCName to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return name.substring(0, idx + 4); |
408 | } | |
409 | | |
410 | | |
411 | /** | |
412 | * Reads the tables 'head', 'hhea', 'OS/2' and 'post' filling several variables. | |
413 | * @throws DocumentException the font is invalid | |
414 | * @throws IOException the font file could not be read | |
415 | */ | |
416 | void fillTables() throws DocumentException, IOException { | |
417 | int[] table_location; | |
418 | table_location = (int[])tables.get("head"); | |
419 |
1
1. fillTables : negated conditional → NO_COVERAGE |
if (table_location == null) |
420 | throw new DocumentException(MessageLocalization.getComposedMessage("table.1.does.not.exist.in.2", "head", fileName + style)); | |
421 |
2
1. fillTables : Replaced integer addition with subtraction → NO_COVERAGE 2. fillTables : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + 16); |
422 | head.flags = rf.readUnsignedShort(); | |
423 | head.unitsPerEm = rf.readUnsignedShort(); | |
424 | rf.skipBytes(16); | |
425 | head.xMin = rf.readShort(); | |
426 | head.yMin = rf.readShort(); | |
427 | head.xMax = rf.readShort(); | |
428 | head.yMax = rf.readShort(); | |
429 | head.macStyle = rf.readUnsignedShort(); | |
430 | | |
431 | table_location = (int[])tables.get("hhea"); | |
432 |
1
1. fillTables : negated conditional → NO_COVERAGE |
if (table_location == null) |
433 | throw new DocumentException(MessageLocalization.getComposedMessage("table.1.does.not.exist.in.2", "hhea", fileName + style)); | |
434 |
2
1. fillTables : Replaced integer addition with subtraction → NO_COVERAGE 2. fillTables : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + 4); |
435 | hhea.Ascender = rf.readShort(); | |
436 | hhea.Descender = rf.readShort(); | |
437 | hhea.LineGap = rf.readShort(); | |
438 | hhea.advanceWidthMax = rf.readUnsignedShort(); | |
439 | hhea.minLeftSideBearing = rf.readShort(); | |
440 | hhea.minRightSideBearing = rf.readShort(); | |
441 | hhea.xMaxExtent = rf.readShort(); | |
442 | hhea.caretSlopeRise = rf.readShort(); | |
443 | hhea.caretSlopeRun = rf.readShort(); | |
444 | rf.skipBytes(12); | |
445 | hhea.numberOfHMetrics = rf.readUnsignedShort(); | |
446 | | |
447 | table_location = (int[])tables.get("OS/2"); | |
448 |
1
1. fillTables : negated conditional → NO_COVERAGE |
if (table_location == null) |
449 | throw new DocumentException(MessageLocalization.getComposedMessage("table.1.does.not.exist.in.2", "OS/2", fileName + style)); | |
450 |
1
1. fillTables : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0]); |
451 | int version = rf.readUnsignedShort(); | |
452 | os_2.xAvgCharWidth = rf.readShort(); | |
453 | os_2.usWeightClass = rf.readUnsignedShort(); | |
454 | os_2.usWidthClass = rf.readUnsignedShort(); | |
455 | os_2.fsType = rf.readShort(); | |
456 | os_2.ySubscriptXSize = rf.readShort(); | |
457 | os_2.ySubscriptYSize = rf.readShort(); | |
458 | os_2.ySubscriptXOffset = rf.readShort(); | |
459 | os_2.ySubscriptYOffset = rf.readShort(); | |
460 | os_2.ySuperscriptXSize = rf.readShort(); | |
461 | os_2.ySuperscriptYSize = rf.readShort(); | |
462 | os_2.ySuperscriptXOffset = rf.readShort(); | |
463 | os_2.ySuperscriptYOffset = rf.readShort(); | |
464 | os_2.yStrikeoutSize = rf.readShort(); | |
465 | os_2.yStrikeoutPosition = rf.readShort(); | |
466 | os_2.sFamilyClass = rf.readShort(); | |
467 |
1
1. fillTables : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::readFully → NO_COVERAGE |
rf.readFully(os_2.panose); |
468 | rf.skipBytes(16); | |
469 |
1
1. fillTables : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::readFully → NO_COVERAGE |
rf.readFully(os_2.achVendID); |
470 | os_2.fsSelection = rf.readUnsignedShort(); | |
471 | os_2.usFirstCharIndex = rf.readUnsignedShort(); | |
472 | os_2.usLastCharIndex = rf.readUnsignedShort(); | |
473 | os_2.sTypoAscender = rf.readShort(); | |
474 | os_2.sTypoDescender = rf.readShort(); | |
475 |
2
1. fillTables : changed conditional boundary → NO_COVERAGE 2. fillTables : negated conditional → NO_COVERAGE |
if (os_2.sTypoDescender > 0) |
476 |
1
1. fillTables : removed negation → NO_COVERAGE |
os_2.sTypoDescender = (short)(-os_2.sTypoDescender); |
477 | os_2.sTypoLineGap = rf.readShort(); | |
478 | os_2.usWinAscent = rf.readUnsignedShort(); | |
479 | os_2.usWinDescent = rf.readUnsignedShort(); | |
480 | os_2.ulCodePageRange1 = 0; | |
481 | os_2.ulCodePageRange2 = 0; | |
482 |
2
1. fillTables : changed conditional boundary → NO_COVERAGE 2. fillTables : negated conditional → NO_COVERAGE |
if (version > 0) { |
483 | os_2.ulCodePageRange1 = rf.readInt(); | |
484 | os_2.ulCodePageRange2 = rf.readInt(); | |
485 | } | |
486 |
2
1. fillTables : changed conditional boundary → NO_COVERAGE 2. fillTables : negated conditional → NO_COVERAGE |
if (version > 1) { |
487 | rf.skipBytes(2); | |
488 | os_2.sCapHeight = rf.readShort(); | |
489 | } | |
490 | else | |
491 |
1
1. fillTables : Replaced double multiplication with division → NO_COVERAGE |
os_2.sCapHeight = (int)(0.7 * head.unitsPerEm); |
492 | | |
493 | table_location = (int[])tables.get("post"); | |
494 |
1
1. fillTables : negated conditional → NO_COVERAGE |
if (table_location == null) { |
495 |
3
1. fillTables : removed negation → NO_COVERAGE 2. fillTables : Replaced double multiplication with division → NO_COVERAGE 3. fillTables : Replaced double division with multiplication → NO_COVERAGE |
italicAngle = -Math.atan2(hhea.caretSlopeRun, hhea.caretSlopeRise) * 180 / Math.PI; |
496 | return; | |
497 | } | |
498 |
2
1. fillTables : Replaced integer addition with subtraction → NO_COVERAGE 2. fillTables : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + 4); |
499 | short mantissa = rf.readShort(); | |
500 | int fraction = rf.readUnsignedShort(); | |
501 |
2
1. fillTables : Replaced double division with multiplication → NO_COVERAGE 2. fillTables : Replaced double addition with subtraction → NO_COVERAGE |
italicAngle = mantissa + fraction / 16384.0d; |
502 | underlinePosition = rf.readShort(); | |
503 | underlineThickness = rf.readShort(); | |
504 |
1
1. fillTables : negated conditional → NO_COVERAGE |
isFixedPitch = rf.readInt() != 0; |
505 | } | |
506 | | |
507 | /** | |
508 | * Gets the Postscript font name. | |
509 | * @throws DocumentException the font is invalid | |
510 | * @throws IOException the font file could not be read | |
511 | * @return the Postscript font name | |
512 | */ | |
513 | String getBaseFont() throws DocumentException, IOException { | |
514 | int[] table_location; | |
515 | table_location = (int[])tables.get("name"); | |
516 |
1
1. getBaseFont : negated conditional → NO_COVERAGE |
if (table_location == null) |
517 | throw new DocumentException(MessageLocalization.getComposedMessage("table.1.does.not.exist.in.2", "name", fileName + style)); | |
518 |
2
1. getBaseFont : Replaced integer addition with subtraction → NO_COVERAGE 2. getBaseFont : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + 2); |
519 | int numRecords = rf.readUnsignedShort(); | |
520 | int startOfStorage = rf.readUnsignedShort(); | |
521 |
3
1. getBaseFont : changed conditional boundary → NO_COVERAGE 2. getBaseFont : Changed increment from 1 to -1 → NO_COVERAGE 3. getBaseFont : negated conditional → NO_COVERAGE |
for (int k = 0; k < numRecords; ++k) { |
522 | int platformID = rf.readUnsignedShort(); | |
523 | int platformEncodingID = rf.readUnsignedShort(); | |
524 | int languageID = rf.readUnsignedShort(); | |
525 | int nameID = rf.readUnsignedShort(); | |
526 | int length = rf.readUnsignedShort(); | |
527 | int offset = rf.readUnsignedShort(); | |
528 |
1
1. getBaseFont : negated conditional → NO_COVERAGE |
if (nameID == 6) { |
529 |
3
1. getBaseFont : Replaced integer addition with subtraction → NO_COVERAGE 2. getBaseFont : Replaced integer addition with subtraction → NO_COVERAGE 3. getBaseFont : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + startOfStorage + offset); |
530 |
2
1. getBaseFont : negated conditional → NO_COVERAGE 2. getBaseFont : negated conditional → NO_COVERAGE |
if (platformID == 0 || platformID == 3) |
531 |
1
1. getBaseFont : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getBaseFont to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return readUnicodeString(length); |
532 | else | |
533 |
1
1. getBaseFont : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getBaseFont to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return readStandardString(length); |
534 | } | |
535 | } | |
536 | File file = new File(fileName); | |
537 |
1
1. getBaseFont : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getBaseFont to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return file.getName().replace(' ', '-'); |
538 | } | |
539 | | |
540 | /** Extracts the names of the font in all the languages available. | |
541 | * @param id the name id to retrieve | |
542 | * @throws DocumentException on error | |
543 | * @throws IOException on error | |
544 | */ | |
545 | String[][] getNames(int id) throws DocumentException, IOException { | |
546 | int[] table_location; | |
547 | table_location = (int[])tables.get("name"); | |
548 |
1
1. getNames : negated conditional → NO_COVERAGE |
if (table_location == null) |
549 | throw new DocumentException(MessageLocalization.getComposedMessage("table.1.does.not.exist.in.2", "name", fileName + style)); | |
550 |
2
1. getNames : Replaced integer addition with subtraction → NO_COVERAGE 2. getNames : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + 2); |
551 | int numRecords = rf.readUnsignedShort(); | |
552 | int startOfStorage = rf.readUnsignedShort(); | |
553 | ArrayList names = new ArrayList(); | |
554 |
3
1. getNames : changed conditional boundary → NO_COVERAGE 2. getNames : Changed increment from 1 to -1 → NO_COVERAGE 3. getNames : negated conditional → NO_COVERAGE |
for (int k = 0; k < numRecords; ++k) { |
555 | int platformID = rf.readUnsignedShort(); | |
556 | int platformEncodingID = rf.readUnsignedShort(); | |
557 | int languageID = rf.readUnsignedShort(); | |
558 | int nameID = rf.readUnsignedShort(); | |
559 | int length = rf.readUnsignedShort(); | |
560 | int offset = rf.readUnsignedShort(); | |
561 |
1
1. getNames : negated conditional → NO_COVERAGE |
if (nameID == id) { |
562 | int pos = rf.getFilePointer(); | |
563 |
3
1. getNames : Replaced integer addition with subtraction → NO_COVERAGE 2. getNames : Replaced integer addition with subtraction → NO_COVERAGE 3. getNames : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + startOfStorage + offset); |
564 | String name; | |
565 |
4
1. getNames : negated conditional → NO_COVERAGE 2. getNames : negated conditional → NO_COVERAGE 3. getNames : negated conditional → NO_COVERAGE 4. getNames : negated conditional → NO_COVERAGE |
if (platformID == 0 || platformID == 3 || (platformID == 2 && platformEncodingID == 1)){ |
566 | name = readUnicodeString(length); | |
567 | } | |
568 | else { | |
569 | name = readStandardString(length); | |
570 | } | |
571 | names.add(new String[]{String.valueOf(platformID), | |
572 | String.valueOf(platformEncodingID), String.valueOf(languageID), name}); | |
573 |
1
1. getNames : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(pos); |
574 | } | |
575 | } | |
576 | String[][] thisName = new String[names.size()][]; | |
577 |
2
1. getNames : changed conditional boundary → NO_COVERAGE 2. getNames : negated conditional → NO_COVERAGE |
for (int k = 0; k < names.size(); ++k) |
578 | thisName[k] = (String[])names.get(k); | |
579 |
1
1. getNames : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getNames to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return thisName; |
580 | } | |
581 | | |
582 | /** Extracts all the names of the names-Table | |
583 | * @throws DocumentException on error | |
584 | * @throws IOException on error | |
585 | */ | |
586 | String[][] getAllNames() throws DocumentException, IOException { | |
587 | int[] table_location; | |
588 | table_location = (int[])tables.get("name"); | |
589 |
1
1. getAllNames : negated conditional → NO_COVERAGE |
if (table_location == null) |
590 | throw new DocumentException(MessageLocalization.getComposedMessage("table.1.does.not.exist.in.2", "name", fileName + style)); | |
591 |
2
1. getAllNames : Replaced integer addition with subtraction → NO_COVERAGE 2. getAllNames : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + 2); |
592 | int numRecords = rf.readUnsignedShort(); | |
593 | int startOfStorage = rf.readUnsignedShort(); | |
594 | ArrayList names = new ArrayList(); | |
595 |
3
1. getAllNames : changed conditional boundary → NO_COVERAGE 2. getAllNames : Changed increment from 1 to -1 → NO_COVERAGE 3. getAllNames : negated conditional → NO_COVERAGE |
for (int k = 0; k < numRecords; ++k) { |
596 | int platformID = rf.readUnsignedShort(); | |
597 | int platformEncodingID = rf.readUnsignedShort(); | |
598 | int languageID = rf.readUnsignedShort(); | |
599 | int nameID = rf.readUnsignedShort(); | |
600 | int length = rf.readUnsignedShort(); | |
601 | int offset = rf.readUnsignedShort(); | |
602 | int pos = rf.getFilePointer(); | |
603 |
3
1. getAllNames : Replaced integer addition with subtraction → NO_COVERAGE 2. getAllNames : Replaced integer addition with subtraction → NO_COVERAGE 3. getAllNames : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + startOfStorage + offset); |
604 | String name; | |
605 |
4
1. getAllNames : negated conditional → NO_COVERAGE 2. getAllNames : negated conditional → NO_COVERAGE 3. getAllNames : negated conditional → NO_COVERAGE 4. getAllNames : negated conditional → NO_COVERAGE |
if (platformID == 0 || platformID == 3 || (platformID == 2 && platformEncodingID == 1)){ |
606 | name = readUnicodeString(length); | |
607 | } | |
608 | else { | |
609 | name = readStandardString(length); | |
610 | } | |
611 | names.add(new String[]{String.valueOf(nameID), String.valueOf(platformID), | |
612 | String.valueOf(platformEncodingID), String.valueOf(languageID), name}); | |
613 |
1
1. getAllNames : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(pos); |
614 | } | |
615 | String[][] thisName = new String[names.size()][]; | |
616 |
2
1. getAllNames : changed conditional boundary → NO_COVERAGE 2. getAllNames : negated conditional → NO_COVERAGE |
for (int k = 0; k < names.size(); ++k) |
617 | thisName[k] = (String[])names.get(k); | |
618 |
1
1. getAllNames : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getAllNames to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return thisName; |
619 | } | |
620 | | |
621 | void checkCff() { | |
622 | int[] table_location; | |
623 | table_location = (int[])tables.get("CFF "); | |
624 |
1
1. checkCff : negated conditional → NO_COVERAGE |
if (table_location != null) { |
625 | cff = true; | |
626 | cffOffset = table_location[0]; | |
627 | cffLength = table_location[1]; | |
628 | } | |
629 | } | |
630 | ||
631 | /** Reads the font data. | |
632 | * @param ttfAfm the font as a <CODE>byte</CODE> array, possibly <CODE>null</CODE> | |
633 | * @throws DocumentException the font is invalid | |
634 | * @throws IOException the font file could not be read | |
635 | * @since 2.1.5 | |
636 | */ | |
637 | void process(byte[] ttfAfm, boolean preload) throws DocumentException, IOException { | |
638 | tables = new HashMap(); | |
639 | | |
640 | try { | |
641 |
1
1. process : negated conditional → NO_COVERAGE |
if (ttfAfm == null) |
642 | rf = new RandomAccessFileOrArray(fileName, preload, Document.plainRandomAccess); | |
643 | else | |
644 | rf = new RandomAccessFileOrArray(ttfAfm); | |
645 |
2
1. process : changed conditional boundary → NO_COVERAGE 2. process : negated conditional → NO_COVERAGE |
if (ttcIndex.length() > 0) { |
646 | int dirIdx = Integer.parseInt(ttcIndex); | |
647 |
2
1. process : changed conditional boundary → NO_COVERAGE 2. process : negated conditional → NO_COVERAGE |
if (dirIdx < 0) |
648 | throw new DocumentException(MessageLocalization.getComposedMessage("the.font.index.for.1.must.be.positive", fileName)); | |
649 | String mainTag = readStandardString(4); | |
650 |
1
1. process : negated conditional → NO_COVERAGE |
if (!mainTag.equals("ttcf")) |
651 | throw new DocumentException(MessageLocalization.getComposedMessage("1.is.not.a.valid.ttc.file", fileName)); | |
652 | rf.skipBytes(4); | |
653 | int dirCount = rf.readInt(); | |
654 |
2
1. process : changed conditional boundary → NO_COVERAGE 2. process : negated conditional → NO_COVERAGE |
if (dirIdx >= dirCount) |
655 |
1
1. process : Replaced integer subtraction with addition → NO_COVERAGE |
throw new DocumentException(MessageLocalization.getComposedMessage("the.font.index.for.1.must.be.between.0.and.2.it.was.3", fileName, String.valueOf(dirCount - 1), String.valueOf(dirIdx))); |
656 |
1
1. process : Replaced integer multiplication with division → NO_COVERAGE |
rf.skipBytes(dirIdx * 4); |
657 | directoryOffset = rf.readInt(); | |
658 | } | |
659 |
1
1. process : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(directoryOffset); |
660 | int ttId = rf.readInt(); | |
661 |
2
1. process : negated conditional → NO_COVERAGE 2. process : negated conditional → NO_COVERAGE |
if (ttId != 0x00010000 && ttId != 0x4F54544F) |
662 | throw new DocumentException(MessageLocalization.getComposedMessage("1.is.not.a.valid.ttf.or.otf.file", fileName)); | |
663 | int num_tables = rf.readUnsignedShort(); | |
664 | rf.skipBytes(6); | |
665 |
3
1. process : changed conditional boundary → NO_COVERAGE 2. process : Changed increment from 1 to -1 → NO_COVERAGE 3. process : negated conditional → NO_COVERAGE |
for (int k = 0; k < num_tables; ++k) { |
666 | String tag = readStandardString(4); | |
667 | rf.skipBytes(4); | |
668 | int[] table_location = new int[2]; | |
669 | table_location[0] = rf.readInt(); | |
670 | table_location[1] = rf.readInt(); | |
671 | tables.put(tag, table_location); | |
672 | } | |
673 |
1
1. process : removed call to com/lowagie/text/pdf/TrueTypeFont::checkCff → NO_COVERAGE |
checkCff(); |
674 | fontName = getBaseFont(); | |
675 | fullName = getNames(4); //full name | |
676 | familyName = getNames(1); //family name | |
677 | allNameEntries = getAllNames(); | |
678 |
1
1. process : negated conditional → NO_COVERAGE |
if (!justNames) { |
679 |
1
1. process : removed call to com/lowagie/text/pdf/TrueTypeFont::fillTables → NO_COVERAGE |
fillTables(); |
680 |
1
1. process : removed call to com/lowagie/text/pdf/TrueTypeFont::readGlyphWidths → NO_COVERAGE |
readGlyphWidths(); |
681 |
1
1. process : removed call to com/lowagie/text/pdf/TrueTypeFont::readCMaps → NO_COVERAGE |
readCMaps(); |
682 |
1
1. process : removed call to com/lowagie/text/pdf/TrueTypeFont::readKerning → NO_COVERAGE |
readKerning(); |
683 |
1
1. process : removed call to com/lowagie/text/pdf/TrueTypeFont::readBbox → NO_COVERAGE |
readBbox(); |
684 | } | |
685 | } | |
686 | finally { | |
687 |
1
1. process : negated conditional → NO_COVERAGE |
if (rf != null) { |
688 |
1
1. process : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::close → NO_COVERAGE |
rf.close(); |
689 |
1
1. process : negated conditional → NO_COVERAGE |
if (!embedded) |
690 | rf = null; | |
691 | } | |
692 | } | |
693 | } | |
694 | | |
695 | /** Reads a <CODE>String</CODE> from the font file as bytes using the Cp1252 | |
696 | * encoding. | |
697 | * @param length the length of bytes to read | |
698 | * @return the <CODE>String</CODE> read | |
699 | * @throws IOException the font file could not be read | |
700 | */ | |
701 | protected String readStandardString(int length) throws IOException { | |
702 | byte[] buf = new byte[length]; | |
703 |
1
1. readStandardString : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::readFully → NO_COVERAGE |
rf.readFully(buf); |
704 | try { | |
705 |
1
1. readStandardString : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::readStandardString to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return new String(buf, WINANSI); |
706 | } | |
707 | catch (Exception e) { | |
708 | throw new ExceptionConverter(e); | |
709 | } | |
710 | } | |
711 | | |
712 | /** Reads a Unicode <CODE>String</CODE> from the font file. Each character is | |
713 | * represented by two bytes. | |
714 | * @param length the length of bytes to read. The <CODE>String</CODE> will have <CODE>length</CODE>/2 | |
715 | * characters | |
716 | * @return the <CODE>String</CODE> read | |
717 | * @throws IOException the font file could not be read | |
718 | */ | |
719 | protected String readUnicodeString(int length) throws IOException { | |
720 | StringBuilder buf = new StringBuilder(); | |
721 |
1
1. readUnicodeString : Replaced integer division with multiplication → NO_COVERAGE |
length /= 2; |
722 |
3
1. readUnicodeString : changed conditional boundary → NO_COVERAGE 2. readUnicodeString : Changed increment from 1 to -1 → NO_COVERAGE 3. readUnicodeString : negated conditional → NO_COVERAGE |
for (int k = 0; k < length; ++k) { |
723 | buf.append(rf.readChar()); | |
724 | } | |
725 |
1
1. readUnicodeString : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::readUnicodeString to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return buf.toString(); |
726 | } | |
727 | | |
728 | /** Reads the glyphs widths. The widths are extracted from the table 'hmtx'. | |
729 | * The glyphs are normalized to 1000 units. | |
730 | * @throws DocumentException the font is invalid | |
731 | * @throws IOException the font file could not be read | |
732 | */ | |
733 | protected void readGlyphWidths() throws DocumentException, IOException { | |
734 | int[] table_location; | |
735 | table_location = (int[])tables.get("hmtx"); | |
736 |
1
1. readGlyphWidths : negated conditional → NO_COVERAGE |
if (table_location == null) |
737 | throw new DocumentException(MessageLocalization.getComposedMessage("table.1.does.not.exist.in.2", "hmtx", fileName + style)); | |
738 |
1
1. readGlyphWidths : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0]); |
739 | GlyphWidths = new int[hhea.numberOfHMetrics]; | |
740 |
3
1. readGlyphWidths : changed conditional boundary → NO_COVERAGE 2. readGlyphWidths : Changed increment from 1 to -1 → NO_COVERAGE 3. readGlyphWidths : negated conditional → NO_COVERAGE |
for (int k = 0; k < hhea.numberOfHMetrics; ++k) { |
741 |
2
1. readGlyphWidths : Replaced integer multiplication with division → NO_COVERAGE 2. readGlyphWidths : Replaced integer division with multiplication → NO_COVERAGE |
GlyphWidths[k] = (rf.readUnsignedShort() * 1000) / head.unitsPerEm; |
742 | rf.readUnsignedShort(); | |
743 | } | |
744 | } | |
745 | | |
746 | /** Gets a glyph width. | |
747 | * @param glyph the glyph to get the width of | |
748 | * @return the width of the glyph in normalized 1000 units | |
749 | */ | |
750 | protected int getGlyphWidth(int glyph) { | |
751 |
2
1. getGlyphWidth : changed conditional boundary → NO_COVERAGE 2. getGlyphWidth : negated conditional → NO_COVERAGE |
if (glyph >= GlyphWidths.length) |
752 |
1
1. getGlyphWidth : Replaced integer subtraction with addition → NO_COVERAGE |
glyph = GlyphWidths.length - 1; |
753 |
1
1. getGlyphWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return GlyphWidths[glyph]; |
754 | } | |
755 | | |
756 | private void readBbox() throws DocumentException, IOException { | |
757 | int[] tableLocation; | |
758 | tableLocation = (int[])tables.get("head"); | |
759 |
1
1. readBbox : negated conditional → NO_COVERAGE |
if (tableLocation == null) |
760 | throw new DocumentException(MessageLocalization.getComposedMessage("table.1.does.not.exist.in.2", "head", fileName + style)); | |
761 |
2
1. readBbox : Replaced integer addition with subtraction → NO_COVERAGE 2. readBbox : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(tableLocation[0] + TrueTypeFontSubSet.HEAD_LOCA_FORMAT_OFFSET); |
762 |
1
1. readBbox : negated conditional → NO_COVERAGE |
boolean locaShortTable = (rf.readUnsignedShort() == 0); |
763 | tableLocation = (int[])tables.get("loca"); | |
764 |
1
1. readBbox : negated conditional → NO_COVERAGE |
if (tableLocation == null) |
765 | return; | |
766 |
1
1. readBbox : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(tableLocation[0]); |
767 | int[] locaTable; | |
768 |
1
1. readBbox : negated conditional → NO_COVERAGE |
if (locaShortTable) { |
769 |
1
1. readBbox : Replaced integer division with multiplication → NO_COVERAGE |
int entries = tableLocation[1] / 2; |
770 | locaTable = new int[entries]; | |
771 |
3
1. readBbox : changed conditional boundary → NO_COVERAGE 2. readBbox : Changed increment from 1 to -1 → NO_COVERAGE 3. readBbox : negated conditional → NO_COVERAGE |
for (int k = 0; k < entries; ++k) |
772 |
1
1. readBbox : Replaced integer multiplication with division → NO_COVERAGE |
locaTable[k] = rf.readUnsignedShort() * 2; |
773 | } | |
774 | else { | |
775 |
1
1. readBbox : Replaced integer division with multiplication → NO_COVERAGE |
int entries = tableLocation[1] / 4; |
776 | locaTable = new int[entries]; | |
777 |
3
1. readBbox : changed conditional boundary → NO_COVERAGE 2. readBbox : Changed increment from 1 to -1 → NO_COVERAGE 3. readBbox : negated conditional → NO_COVERAGE |
for (int k = 0; k < entries; ++k) |
778 | locaTable[k] = rf.readInt(); | |
779 | } | |
780 | tableLocation = (int[])tables.get("glyf"); | |
781 |
1
1. readBbox : negated conditional → NO_COVERAGE |
if (tableLocation == null) |
782 | throw new DocumentException(MessageLocalization.getComposedMessage("table.1.does.not.exist.in.2", "glyf", fileName + style)); | |
783 | int tableGlyphOffset = tableLocation[0]; | |
784 |
1
1. readBbox : Replaced integer subtraction with addition → NO_COVERAGE |
bboxes = new int[locaTable.length - 1][]; |
785 |
4
1. readBbox : changed conditional boundary → NO_COVERAGE 2. readBbox : Changed increment from 1 to -1 → NO_COVERAGE 3. readBbox : Replaced integer subtraction with addition → NO_COVERAGE 4. readBbox : negated conditional → NO_COVERAGE |
for (int glyph = 0; glyph < locaTable.length - 1; ++glyph) { |
786 | int start = locaTable[glyph]; | |
787 |
2
1. readBbox : Replaced integer addition with subtraction → NO_COVERAGE 2. readBbox : negated conditional → NO_COVERAGE |
if (start != locaTable[glyph + 1]) { |
788 |
3
1. readBbox : Replaced integer addition with subtraction → NO_COVERAGE 2. readBbox : Replaced integer addition with subtraction → NO_COVERAGE 3. readBbox : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(tableGlyphOffset + start + 2); |
789 | bboxes[glyph] = new int[]{ | |
790 |
2
1. readBbox : Replaced integer multiplication with division → NO_COVERAGE 2. readBbox : Replaced integer division with multiplication → NO_COVERAGE |
(rf.readShort() * 1000) / head.unitsPerEm, |
791 |
2
1. readBbox : Replaced integer multiplication with division → NO_COVERAGE 2. readBbox : Replaced integer division with multiplication → NO_COVERAGE |
(rf.readShort() * 1000) / head.unitsPerEm, |
792 |
2
1. readBbox : Replaced integer multiplication with division → NO_COVERAGE 2. readBbox : Replaced integer division with multiplication → NO_COVERAGE |
(rf.readShort() * 1000) / head.unitsPerEm, |
793 |
2
1. readBbox : Replaced integer multiplication with division → NO_COVERAGE 2. readBbox : Replaced integer division with multiplication → NO_COVERAGE |
(rf.readShort() * 1000) / head.unitsPerEm}; |
794 | } | |
795 | } | |
796 | } | |
797 | | |
798 | /** Reads the several maps from the table 'cmap'. The maps of interest are 1.0 for symbolic | |
799 | * fonts and 3.1 for all others. A symbolic font is defined as having the map 3.0. | |
800 | * @throws DocumentException the font is invalid | |
801 | * @throws IOException the font file could not be read | |
802 | */ | |
803 | void readCMaps() throws DocumentException, IOException { | |
804 | int[] table_location; | |
805 | table_location = (int[])tables.get("cmap"); | |
806 |
1
1. readCMaps : negated conditional → NO_COVERAGE |
if (table_location == null) |
807 | throw new DocumentException(MessageLocalization.getComposedMessage("table.1.does.not.exist.in.2", "cmap", fileName + style)); | |
808 |
1
1. readCMaps : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0]); |
809 | rf.skipBytes(2); | |
810 | int num_tables = rf.readUnsignedShort(); | |
811 | fontSpecific = false; | |
812 | int map10 = 0; | |
813 | int map31 = 0; | |
814 | int map30 = 0; | |
815 | int mapExt = 0; | |
816 |
3
1. readCMaps : changed conditional boundary → NO_COVERAGE 2. readCMaps : Changed increment from 1 to -1 → NO_COVERAGE 3. readCMaps : negated conditional → NO_COVERAGE |
for (int k = 0; k < num_tables; ++k) { |
817 | int platId = rf.readUnsignedShort(); | |
818 | int platSpecId = rf.readUnsignedShort(); | |
819 | int offset = rf.readInt(); | |
820 |
2
1. readCMaps : negated conditional → NO_COVERAGE 2. readCMaps : negated conditional → NO_COVERAGE |
if (platId == 3 && platSpecId == 0) { |
821 | fontSpecific = true; | |
822 | map30 = offset; | |
823 | } | |
824 |
2
1. readCMaps : negated conditional → NO_COVERAGE 2. readCMaps : negated conditional → NO_COVERAGE |
else if (platId == 3 && platSpecId == 1) { |
825 | map31 = offset; | |
826 | } | |
827 |
2
1. readCMaps : negated conditional → NO_COVERAGE 2. readCMaps : negated conditional → NO_COVERAGE |
else if (platId == 3 && platSpecId == 10) { |
828 | mapExt = offset; | |
829 | } | |
830 |
2
1. readCMaps : negated conditional → NO_COVERAGE 2. readCMaps : negated conditional → NO_COVERAGE |
if (platId == 1 && platSpecId == 0) { |
831 | map10 = offset; | |
832 | } | |
833 | } | |
834 |
2
1. readCMaps : changed conditional boundary → NO_COVERAGE 2. readCMaps : negated conditional → NO_COVERAGE |
if (map10 > 0) { |
835 |
2
1. readCMaps : Replaced integer addition with subtraction → NO_COVERAGE 2. readCMaps : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + map10); |
836 | int format = rf.readUnsignedShort(); | |
837 | switch (format) { | |
838 | case 0: | |
839 | cmap10 = readFormat0(); | |
840 | break; | |
841 | case 4: | |
842 | cmap10 = readFormat4(); | |
843 | break; | |
844 | case 6: | |
845 | cmap10 = readFormat6(); | |
846 | break; | |
847 | } | |
848 | } | |
849 |
2
1. readCMaps : changed conditional boundary → NO_COVERAGE 2. readCMaps : negated conditional → NO_COVERAGE |
if (map31 > 0) { |
850 |
2
1. readCMaps : Replaced integer addition with subtraction → NO_COVERAGE 2. readCMaps : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + map31); |
851 | int format = rf.readUnsignedShort(); | |
852 |
1
1. readCMaps : negated conditional → NO_COVERAGE |
if (format == 4) { |
853 | cmap31 = readFormat4(); | |
854 | } | |
855 | } | |
856 |
2
1. readCMaps : changed conditional boundary → NO_COVERAGE 2. readCMaps : negated conditional → NO_COVERAGE |
if (map30 > 0) { |
857 |
2
1. readCMaps : Replaced integer addition with subtraction → NO_COVERAGE 2. readCMaps : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + map30); |
858 | int format = rf.readUnsignedShort(); | |
859 |
1
1. readCMaps : negated conditional → NO_COVERAGE |
if (format == 4) { |
860 | cmap10 = readFormat4(); | |
861 | } | |
862 | } | |
863 |
2
1. readCMaps : changed conditional boundary → NO_COVERAGE 2. readCMaps : negated conditional → NO_COVERAGE |
if (mapExt > 0) { |
864 |
2
1. readCMaps : Replaced integer addition with subtraction → NO_COVERAGE 2. readCMaps : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + mapExt); |
865 | int format = rf.readUnsignedShort(); | |
866 | switch (format) { | |
867 | case 0: | |
868 | cmapExt = readFormat0(); | |
869 | break; | |
870 | case 4: | |
871 | cmapExt = readFormat4(); | |
872 | break; | |
873 | case 6: | |
874 | cmapExt = readFormat6(); | |
875 | break; | |
876 | case 12: | |
877 | cmapExt = readFormat12(); | |
878 | break; | |
879 | } | |
880 | } | |
881 | } | |
882 | ||
883 | HashMap readFormat12() throws IOException { | |
884 | HashMap h = new HashMap(); | |
885 | rf.skipBytes(2); | |
886 | int table_lenght = rf.readInt(); | |
887 | rf.skipBytes(4); | |
888 | int nGroups = rf.readInt(); | |
889 |
3
1. readFormat12 : changed conditional boundary → NO_COVERAGE 2. readFormat12 : Changed increment from 1 to -1 → NO_COVERAGE 3. readFormat12 : negated conditional → NO_COVERAGE |
for (int k = 0; k < nGroups; k++) { |
890 | int startCharCode = rf.readInt(); | |
891 | int endCharCode = rf.readInt(); | |
892 | int startGlyphID = rf.readInt(); | |
893 |
3
1. readFormat12 : changed conditional boundary → NO_COVERAGE 2. readFormat12 : Changed increment from 1 to -1 → NO_COVERAGE 3. readFormat12 : negated conditional → NO_COVERAGE |
for (int i = startCharCode; i <= endCharCode; i++) { |
894 | int[] r = new int[2]; | |
895 | r[0] = startGlyphID; | |
896 | r[1] = getGlyphWidth(r[0]); | |
897 | h.put(i, r); | |
898 |
1
1. readFormat12 : Changed increment from 1 to -1 → NO_COVERAGE |
startGlyphID++; |
899 | } | |
900 | } | |
901 |
1
1. readFormat12 : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::readFormat12 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return h; |
902 | } | |
903 | | |
904 | /** The information in the maps of the table 'cmap' is coded in several formats. | |
905 | * Format 0 is the Apple standard character to glyph index mapping table. | |
906 | * @return a <CODE>HashMap</CODE> representing this map | |
907 | * @throws IOException the font file could not be read | |
908 | */ | |
909 | HashMap readFormat0() throws IOException { | |
910 | HashMap h = new HashMap(); | |
911 | rf.skipBytes(4); | |
912 |
3
1. readFormat0 : changed conditional boundary → NO_COVERAGE 2. readFormat0 : Changed increment from 1 to -1 → NO_COVERAGE 3. readFormat0 : negated conditional → NO_COVERAGE |
for (int k = 0; k < 256; ++k) { |
913 | int[] r = new int[2]; | |
914 | r[0] = rf.readUnsignedByte(); | |
915 | r[1] = getGlyphWidth(r[0]); | |
916 | h.put(k, r); | |
917 | } | |
918 |
1
1. readFormat0 : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::readFormat0 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return h; |
919 | } | |
920 | | |
921 | /** The information in the maps of the table 'cmap' is coded in several formats. | |
922 | * Format 4 is the Microsoft standard character to glyph index mapping table. | |
923 | * @return a <CODE>HashMap</CODE> representing this map | |
924 | * @throws IOException the font file could not be read | |
925 | */ | |
926 | HashMap readFormat4() throws IOException { | |
927 | HashMap h = new HashMap(); | |
928 | int table_lenght = rf.readUnsignedShort(); | |
929 | rf.skipBytes(2); | |
930 |
1
1. readFormat4 : Replaced integer division with multiplication → NO_COVERAGE |
int segCount = rf.readUnsignedShort() / 2; |
931 | rf.skipBytes(6); | |
932 | int[] endCount = new int[segCount]; | |
933 |
3
1. readFormat4 : changed conditional boundary → NO_COVERAGE 2. readFormat4 : Changed increment from 1 to -1 → NO_COVERAGE 3. readFormat4 : negated conditional → NO_COVERAGE |
for (int k = 0; k < segCount; ++k) { |
934 | endCount[k] = rf.readUnsignedShort(); | |
935 | } | |
936 | rf.skipBytes(2); | |
937 | int[] startCount = new int[segCount]; | |
938 |
3
1. readFormat4 : changed conditional boundary → NO_COVERAGE 2. readFormat4 : Changed increment from 1 to -1 → NO_COVERAGE 3. readFormat4 : negated conditional → NO_COVERAGE |
for (int k = 0; k < segCount; ++k) { |
939 | startCount[k] = rf.readUnsignedShort(); | |
940 | } | |
941 | int[] idDelta = new int[segCount]; | |
942 |
3
1. readFormat4 : changed conditional boundary → NO_COVERAGE 2. readFormat4 : Changed increment from 1 to -1 → NO_COVERAGE 3. readFormat4 : negated conditional → NO_COVERAGE |
for (int k = 0; k < segCount; ++k) { |
943 | idDelta[k] = rf.readUnsignedShort(); | |
944 | } | |
945 | int[] idRO = new int[segCount]; | |
946 |
3
1. readFormat4 : changed conditional boundary → NO_COVERAGE 2. readFormat4 : Changed increment from 1 to -1 → NO_COVERAGE 3. readFormat4 : negated conditional → NO_COVERAGE |
for (int k = 0; k < segCount; ++k) { |
947 | idRO[k] = rf.readUnsignedShort(); | |
948 | } | |
949 |
4
1. readFormat4 : Replaced integer division with multiplication → NO_COVERAGE 2. readFormat4 : Replaced integer subtraction with addition → NO_COVERAGE 3. readFormat4 : Replaced integer multiplication with division → NO_COVERAGE 4. readFormat4 : Replaced integer subtraction with addition → NO_COVERAGE |
int[] glyphId = new int[table_lenght / 2 - 8 - segCount * 4]; |
950 |
2
1. readFormat4 : changed conditional boundary → NO_COVERAGE 2. readFormat4 : negated conditional → NO_COVERAGE |
for (int k = 0; k < glyphId.length; ++k) { |
951 | glyphId[k] = rf.readUnsignedShort(); | |
952 | } | |
953 |
3
1. readFormat4 : changed conditional boundary → NO_COVERAGE 2. readFormat4 : Changed increment from 1 to -1 → NO_COVERAGE 3. readFormat4 : negated conditional → NO_COVERAGE |
for (int k = 0; k < segCount; ++k) { |
954 | int glyph; | |
955 |
4
1. readFormat4 : changed conditional boundary → NO_COVERAGE 2. readFormat4 : Changed increment from 1 to -1 → NO_COVERAGE 3. readFormat4 : negated conditional → NO_COVERAGE 4. readFormat4 : negated conditional → NO_COVERAGE |
for (int j = startCount[k]; j <= endCount[k] && j != 0xFFFF; ++j) { |
956 |
1
1. readFormat4 : negated conditional → NO_COVERAGE |
if (idRO[k] == 0) { |
957 |
2
1. readFormat4 : Replaced integer addition with subtraction → NO_COVERAGE 2. readFormat4 : Replaced bitwise AND with OR → NO_COVERAGE |
glyph = (j + idDelta[k]) & 0xFFFF; |
958 | } | |
959 | else { | |
960 |
5
1. readFormat4 : Replaced integer division with multiplication → NO_COVERAGE 2. readFormat4 : Replaced integer addition with subtraction → NO_COVERAGE 3. readFormat4 : Replaced integer subtraction with addition → NO_COVERAGE 4. readFormat4 : Replaced integer addition with subtraction → NO_COVERAGE 5. readFormat4 : Replaced integer subtraction with addition → NO_COVERAGE |
int idx = k + idRO[k] / 2 - segCount + j - startCount[k]; |
961 |
2
1. readFormat4 : changed conditional boundary → NO_COVERAGE 2. readFormat4 : negated conditional → NO_COVERAGE |
if (idx >= glyphId.length) |
962 | continue; | |
963 |
2
1. readFormat4 : Replaced integer addition with subtraction → NO_COVERAGE 2. readFormat4 : Replaced bitwise AND with OR → NO_COVERAGE |
glyph = (glyphId[idx] + idDelta[k]) & 0xFFFF; |
964 | } | |
965 | int[] r = new int[2]; | |
966 | r[0] = glyph; | |
967 | r[1] = getGlyphWidth(r[0]); | |
968 |
4
1. readFormat4 : Replaced bitwise AND with OR → NO_COVERAGE 2. readFormat4 : Replaced bitwise AND with OR → NO_COVERAGE 3. readFormat4 : negated conditional → NO_COVERAGE 4. readFormat4 : negated conditional → NO_COVERAGE |
h.put(fontSpecific ? ((j & 0xff00) == 0xf000 ? j & 0xff : j) : j, r); |
969 | } | |
970 | } | |
971 |
1
1. readFormat4 : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::readFormat4 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return h; |
972 | } | |
973 | | |
974 | /** The information in the maps of the table 'cmap' is coded in several formats. | |
975 | * Format 6 is a trimmed table mapping. It is similar to format 0 but can have | |
976 | * less than 256 entries. | |
977 | * @return a <CODE>HashMap</CODE> representing this map | |
978 | * @throws IOException the font file could not be read | |
979 | */ | |
980 | HashMap readFormat6() throws IOException { | |
981 | HashMap h = new HashMap(); | |
982 | rf.skipBytes(4); | |
983 | int start_code = rf.readUnsignedShort(); | |
984 | int code_count = rf.readUnsignedShort(); | |
985 |
3
1. readFormat6 : changed conditional boundary → NO_COVERAGE 2. readFormat6 : Changed increment from 1 to -1 → NO_COVERAGE 3. readFormat6 : negated conditional → NO_COVERAGE |
for (int k = 0; k < code_count; ++k) { |
986 | int[] r = new int[2]; | |
987 | r[0] = rf.readUnsignedShort(); | |
988 | r[1] = getGlyphWidth(r[0]); | |
989 |
1
1. readFormat6 : Replaced integer addition with subtraction → NO_COVERAGE |
h.put(k + start_code, r); |
990 | } | |
991 |
1
1. readFormat6 : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::readFormat6 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return h; |
992 | } | |
993 | | |
994 | /** Reads the kerning information from the 'kern' table. | |
995 | * @throws IOException the font file could not be read | |
996 | */ | |
997 | void readKerning() throws IOException { | |
998 | int[] table_location; | |
999 | table_location = (int[])tables.get("kern"); | |
1000 |
1
1. readKerning : negated conditional → NO_COVERAGE |
if (table_location == null) |
1001 | return; | |
1002 |
2
1. readKerning : Replaced integer addition with subtraction → NO_COVERAGE 2. readKerning : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(table_location[0] + 2); |
1003 | int nTables = rf.readUnsignedShort(); | |
1004 |
1
1. readKerning : Replaced integer addition with subtraction → NO_COVERAGE |
int checkpoint = table_location[0] + 4; |
1005 | int length = 0; | |
1006 |
3
1. readKerning : changed conditional boundary → NO_COVERAGE 2. readKerning : Changed increment from 1 to -1 → NO_COVERAGE 3. readKerning : negated conditional → NO_COVERAGE |
for (int k = 0; k < nTables; ++k) { |
1007 |
1
1. readKerning : Replaced integer addition with subtraction → NO_COVERAGE |
checkpoint += length; |
1008 |
1
1. readKerning : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf.seek(checkpoint); |
1009 | rf.skipBytes(2); | |
1010 | length = rf.readUnsignedShort(); | |
1011 | int coverage = rf.readUnsignedShort(); | |
1012 |
2
1. readKerning : Replaced bitwise AND with OR → NO_COVERAGE 2. readKerning : negated conditional → NO_COVERAGE |
if ((coverage & 0xfff7) == 0x0001) { |
1013 | int nPairs = rf.readUnsignedShort(); | |
1014 | rf.skipBytes(6); | |
1015 |
3
1. readKerning : changed conditional boundary → NO_COVERAGE 2. readKerning : Changed increment from 1 to -1 → NO_COVERAGE 3. readKerning : negated conditional → NO_COVERAGE |
for (int j = 0; j < nPairs; ++j) { |
1016 | int pair = rf.readInt(); | |
1017 |
2
1. readKerning : Replaced integer multiplication with division → NO_COVERAGE 2. readKerning : Replaced integer division with multiplication → NO_COVERAGE |
int value = rf.readShort() * 1000 / head.unitsPerEm; |
1018 | kerning.put(pair, value); | |
1019 | } | |
1020 | } | |
1021 | } | |
1022 | } | |
1023 | | |
1024 | /** Gets the kerning between two Unicode chars. | |
1025 | * @param char1 the first char | |
1026 | * @param char2 the second char | |
1027 | * @return the kerning to be applied | |
1028 | */ | |
1029 | public int getKerning(int char1, int char2) { | |
1030 | int[] metrics = getMetricsTT(char1); | |
1031 |
1
1. getKerning : negated conditional → NO_COVERAGE |
if (metrics == null) |
1032 |
1
1. getKerning : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return 0; |
1033 | int c1 = metrics[0]; | |
1034 | metrics = getMetricsTT(char2); | |
1035 |
1
1. getKerning : negated conditional → NO_COVERAGE |
if (metrics == null) |
1036 |
1
1. getKerning : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return 0; |
1037 | int c2 = metrics[0]; | |
1038 |
3
1. getKerning : Replaced Shift Left with Shift Right → NO_COVERAGE 2. getKerning : Replaced integer addition with subtraction → NO_COVERAGE 3. getKerning : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return kerning.get((c1 << 16) + c2); |
1039 | } | |
1040 | | |
1041 | /** Gets the width from the font according to the unicode char <CODE>c</CODE>. | |
1042 | * If the <CODE>name</CODE> is null it's a symbolic font. | |
1043 | * @param c the unicode char | |
1044 | * @param name the glyph name | |
1045 | * @return the width of the char | |
1046 | */ | |
1047 | int getRawWidth(int c, String name) { | |
1048 | int[] metric = getMetricsTT(c); | |
1049 |
1
1. getRawWidth : negated conditional → NO_COVERAGE |
if (metric == null) |
1050 |
1
1. getRawWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return 0; |
1051 |
1
1. getRawWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return metric[1]; |
1052 | } | |
1053 | | |
1054 | /** Generates the font descriptor for this font. | |
1055 | * @return the PdfDictionary containing the font descriptor or <CODE>null</CODE> | |
1056 | * @param subsetPrefix the subset prefix | |
1057 | * @param fontStream the indirect reference to a PdfStream containing the font or <CODE>null</CODE> | |
1058 | */ | |
1059 | protected PdfDictionary getFontDescriptor(PdfIndirectReference fontStream, String subsetPrefix, PdfIndirectReference cidset) { | |
1060 | PdfDictionary dic = new PdfDictionary(PdfName.FONTDESCRIPTOR); | |
1061 |
3
1. getFontDescriptor : Replaced integer multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced integer division with multiplication → NO_COVERAGE 3. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.ASCENT, new PdfNumber(os_2.sTypoAscender * 1000 / head.unitsPerEm)); |
1062 |
3
1. getFontDescriptor : Replaced integer multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced integer division with multiplication → NO_COVERAGE 3. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.CAPHEIGHT, new PdfNumber(os_2.sCapHeight * 1000 / head.unitsPerEm)); |
1063 |
3
1. getFontDescriptor : Replaced integer multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced integer division with multiplication → NO_COVERAGE 3. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.DESCENT, new PdfNumber(os_2.sTypoDescender * 1000 / head.unitsPerEm)); |
1064 |
9
1. getFontDescriptor : Replaced integer multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced integer division with multiplication → NO_COVERAGE 3. getFontDescriptor : Replaced integer multiplication with division → NO_COVERAGE 4. getFontDescriptor : Replaced integer division with multiplication → NO_COVERAGE 5. getFontDescriptor : Replaced integer multiplication with division → NO_COVERAGE 6. getFontDescriptor : Replaced integer division with multiplication → NO_COVERAGE 7. getFontDescriptor : Replaced integer multiplication with division → NO_COVERAGE 8. getFontDescriptor : Replaced integer division with multiplication → NO_COVERAGE 9. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.FONTBBOX, new PdfRectangle( |
1065 | head.xMin * 1000 / head.unitsPerEm, | |
1066 | head.yMin * 1000 / head.unitsPerEm, | |
1067 | head.xMax * 1000 / head.unitsPerEm, | |
1068 | head.yMax * 1000 / head.unitsPerEm)); | |
1069 |
1
1. getFontDescriptor : negated conditional → NO_COVERAGE |
if (cidset != null) |
1070 |
1
1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.CIDSET, cidset); |
1071 |
1
1. getFontDescriptor : negated conditional → NO_COVERAGE |
if (cff) { |
1072 |
1
1. getFontDescriptor : negated conditional → NO_COVERAGE |
if (encoding.startsWith("Identity-")) |
1073 |
1
1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.FONTNAME, new PdfName(subsetPrefix + fontName+"-"+encoding)); |
1074 | else | |
1075 |
1
1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.FONTNAME, new PdfName(subsetPrefix + fontName + style)); |
1076 | } | |
1077 | else | |
1078 |
1
1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.FONTNAME, new PdfName(subsetPrefix + fontName + style)); |
1079 |
1
1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.ITALICANGLE, new PdfNumber(italicAngle)); |
1080 |
1
1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.STEMV, new PdfNumber(80)); |
1081 |
1
1. getFontDescriptor : negated conditional → NO_COVERAGE |
if (fontStream != null) { |
1082 |
1
1. getFontDescriptor : negated conditional → NO_COVERAGE |
if (cff) |
1083 |
1
1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.FONTFILE3, fontStream); |
1084 | else | |
1085 |
1
1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.FONTFILE2, fontStream); |
1086 | } | |
1087 | int flags = 0; | |
1088 |
1
1. getFontDescriptor : negated conditional → NO_COVERAGE |
if (isFixedPitch) |
1089 |
1
1. getFontDescriptor : Replaced bitwise OR with AND → NO_COVERAGE |
flags |= 1; |
1090 |
2
1. getFontDescriptor : Replaced bitwise OR with AND → NO_COVERAGE 2. getFontDescriptor : negated conditional → NO_COVERAGE |
flags |= fontSpecific ? 4 : 32; |
1091 |
2
1. getFontDescriptor : Replaced bitwise AND with OR → NO_COVERAGE 2. getFontDescriptor : negated conditional → NO_COVERAGE |
if ((head.macStyle & 2) != 0) |
1092 |
1
1. getFontDescriptor : Replaced bitwise OR with AND → NO_COVERAGE |
flags |= 64; |
1093 |
2
1. getFontDescriptor : Replaced bitwise AND with OR → NO_COVERAGE 2. getFontDescriptor : negated conditional → NO_COVERAGE |
if ((head.macStyle & 1) != 0) |
1094 |
1
1. getFontDescriptor : Replaced bitwise OR with AND → NO_COVERAGE |
flags |= 262144; |
1095 |
1
1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.FLAGS, new PdfNumber(flags)); |
1096 | | |
1097 |
1
1. getFontDescriptor : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return dic; |
1098 | } | |
1099 | | |
1100 | /** Generates the font dictionary for this font. | |
1101 | * @return the PdfDictionary containing the font dictionary | |
1102 | * @param subsetPrefix the subset prefix | |
1103 | * @param firstChar the first valid character | |
1104 | * @param lastChar the last valid character | |
1105 | * @param shortTag a 256 bytes long <CODE>byte</CODE> array where each unused byte is represented by 0 | |
1106 | * @param fontDescriptor the indirect reference to a PdfDictionary containing the font descriptor or <CODE>null</CODE> | |
1107 | */ | |
1108 | protected PdfDictionary getFontBaseType(PdfIndirectReference fontDescriptor, String subsetPrefix, int firstChar, int lastChar, byte[] shortTag) { | |
1109 | PdfDictionary dic = new PdfDictionary(PdfName.FONT); | |
1110 |
1
1. getFontBaseType : negated conditional → NO_COVERAGE |
if (cff) { |
1111 |
1
1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.SUBTYPE, PdfName.TYPE1); |
1112 |
1
1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.BASEFONT, new PdfName(fontName + style)); |
1113 | } | |
1114 | else { | |
1115 |
1
1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.SUBTYPE, PdfName.TRUETYPE); |
1116 |
1
1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.BASEFONT, new PdfName(subsetPrefix + fontName + style)); |
1117 | } | |
1118 |
1
1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.BASEFONT, new PdfName(subsetPrefix + fontName + style)); |
1119 |
1
1. getFontBaseType : negated conditional → NO_COVERAGE |
if (!fontSpecific) { |
1120 |
3
1. getFontBaseType : changed conditional boundary → NO_COVERAGE 2. getFontBaseType : Changed increment from 1 to -1 → NO_COVERAGE 3. getFontBaseType : negated conditional → NO_COVERAGE |
for (int k = firstChar; k <= lastChar; ++k) { |
1121 |
1
1. getFontBaseType : negated conditional → NO_COVERAGE |
if (!differences[k].equals(notdef)) { |
1122 | firstChar = k; | |
1123 | break; | |
1124 | } | |
1125 | } | |
1126 |
2
1. getFontBaseType : negated conditional → NO_COVERAGE 2. getFontBaseType : negated conditional → NO_COVERAGE |
if (encoding.equals("Cp1252") || encoding.equals("MacRoman")) |
1127 |
2
1. getFontBaseType : negated conditional → NO_COVERAGE 2. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.ENCODING, encoding.equals("Cp1252") ? PdfName.WIN_ANSI_ENCODING : PdfName.MAC_ROMAN_ENCODING); |
1128 | else { | |
1129 | PdfDictionary enc = new PdfDictionary(PdfName.ENCODING); | |
1130 | PdfArray dif = new PdfArray(); | |
1131 | boolean gap = true; | |
1132 |
3
1. getFontBaseType : changed conditional boundary → NO_COVERAGE 2. getFontBaseType : Changed increment from 1 to -1 → NO_COVERAGE 3. getFontBaseType : negated conditional → NO_COVERAGE |
for (int k = firstChar; k <= lastChar; ++k) { |
1133 |
1
1. getFontBaseType : negated conditional → NO_COVERAGE |
if (shortTag[k] != 0) { |
1134 |
1
1. getFontBaseType : negated conditional → NO_COVERAGE |
if (gap) { |
1135 | dif.add(new PdfNumber(k)); | |
1136 | gap = false; | |
1137 | } | |
1138 | dif.add(new PdfName(differences[k])); | |
1139 | } | |
1140 | else | |
1141 | gap = true; | |
1142 | } | |
1143 |
1
1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
enc.put(PdfName.DIFFERENCES, dif); |
1144 |
1
1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.ENCODING, enc); |
1145 | } | |
1146 | } | |
1147 |
1
1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.FIRSTCHAR, new PdfNumber(firstChar)); |
1148 |
1
1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.LASTCHAR, new PdfNumber(lastChar)); |
1149 | PdfArray wd = new PdfArray(); | |
1150 |
3
1. getFontBaseType : changed conditional boundary → NO_COVERAGE 2. getFontBaseType : Changed increment from 1 to -1 → NO_COVERAGE 3. getFontBaseType : negated conditional → NO_COVERAGE |
for (int k = firstChar; k <= lastChar; ++k) { |
1151 |
1
1. getFontBaseType : negated conditional → NO_COVERAGE |
if (shortTag[k] == 0) |
1152 | wd.add(new PdfNumber(0)); | |
1153 | else | |
1154 | wd.add(new PdfNumber(widths[k])); | |
1155 | } | |
1156 |
1
1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.WIDTHS, wd); |
1157 |
1
1. getFontBaseType : negated conditional → NO_COVERAGE |
if (fontDescriptor != null) |
1158 |
1
1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE |
dic.put(PdfName.FONTDESCRIPTOR, fontDescriptor); |
1159 |
1
1. getFontBaseType : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getFontBaseType to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return dic; |
1160 | } | |
1161 | | |
1162 | protected byte[] getFullFont() throws IOException { | |
1163 | RandomAccessFileOrArray rf2 = null; | |
1164 | try { | |
1165 | rf2 = new RandomAccessFileOrArray(rf); | |
1166 |
1
1. getFullFont : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::reOpen → NO_COVERAGE |
rf2.reOpen(); |
1167 | byte[] b = new byte[rf2.length()]; | |
1168 |
1
1. getFullFont : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::readFully → NO_COVERAGE |
rf2.readFully(b); |
1169 |
1
1. getFullFont : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getFullFont to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return b; |
1170 | } | |
1171 | finally { | |
1172 |
2
1. getFullFont : negated conditional → NO_COVERAGE 2. getFullFont : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::close → NO_COVERAGE |
try {if (rf2 != null) {rf2.close();}} catch (Exception e) {} |
1173 | } | |
1174 | } | |
1175 | | |
1176 | protected static int[] compactRanges(ArrayList ranges) { | |
1177 | ArrayList simp = new ArrayList(); | |
1178 | for (Object range : ranges) { | |
1179 | int[] r = (int[]) range; | |
1180 |
2
1. compactRanges : changed conditional boundary → NO_COVERAGE 2. compactRanges : negated conditional → NO_COVERAGE |
for (int j = 0; j < r.length; j += 2) { |
1181 |
2
1. compactRanges : Replaced integer addition with subtraction → NO_COVERAGE 2. compactRanges : Replaced integer addition with subtraction → NO_COVERAGE |
simp.add(new int[]{Math.max(0, Math.min(r[j], r[j + 1])), Math.min(0xffff, Math.max(r[j], r[j + 1]))}); |
1182 | } | |
1183 | } | |
1184 |
4
1. compactRanges : changed conditional boundary → NO_COVERAGE 2. compactRanges : Changed increment from 1 to -1 → NO_COVERAGE 3. compactRanges : Replaced integer subtraction with addition → NO_COVERAGE 4. compactRanges : negated conditional → NO_COVERAGE |
for (int k1 = 0; k1 < simp.size() - 1; ++k1) { |
1185 |
3
1. compactRanges : changed conditional boundary → NO_COVERAGE 2. compactRanges : Replaced integer addition with subtraction → NO_COVERAGE 3. compactRanges : negated conditional → NO_COVERAGE |
for (int k2 = k1 + 1; k2 < simp.size(); ++k2) { |
1186 | int[] r1 = (int[])simp.get(k1); | |
1187 | int[] r2 = (int[])simp.get(k2); | |
1188 |
8
1. compactRanges : changed conditional boundary → NO_COVERAGE 2. compactRanges : changed conditional boundary → NO_COVERAGE 3. compactRanges : changed conditional boundary → NO_COVERAGE 4. compactRanges : changed conditional boundary → NO_COVERAGE 5. compactRanges : negated conditional → NO_COVERAGE 6. compactRanges : negated conditional → NO_COVERAGE 7. compactRanges : negated conditional → NO_COVERAGE 8. compactRanges : negated conditional → NO_COVERAGE |
if ((r1[0] >= r2[0] && r1[0] <= r2[1]) || (r1[1] >= r2[0] && r1[0] <= r2[1])) { |
1189 | r1[0] = Math.min(r1[0], r2[0]); | |
1190 | r1[1] = Math.max(r1[1], r2[1]); | |
1191 | simp.remove(k2); | |
1192 |
1
1. compactRanges : Changed increment from -1 to 1 → NO_COVERAGE |
--k2; |
1193 | } | |
1194 | } | |
1195 | } | |
1196 |
1
1. compactRanges : Replaced integer multiplication with division → NO_COVERAGE |
int[] s = new int[simp.size() * 2]; |
1197 |
2
1. compactRanges : changed conditional boundary → NO_COVERAGE 2. compactRanges : negated conditional → NO_COVERAGE |
for (int k = 0; k < simp.size(); ++k) { |
1198 | int[] r = (int[])simp.get(k); | |
1199 |
1
1. compactRanges : Replaced integer multiplication with division → NO_COVERAGE |
s[k * 2] = r[0]; |
1200 |
2
1. compactRanges : Replaced integer multiplication with division → NO_COVERAGE 2. compactRanges : Replaced integer addition with subtraction → NO_COVERAGE |
s[k * 2 + 1] = r[1]; |
1201 | } | |
1202 |
1
1. compactRanges : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::compactRanges to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return s; |
1203 | } | |
1204 | | |
1205 | protected void addRangeUni(HashMap longTag, boolean includeMetrics, boolean subsetp) { | |
1206 |
4
1. addRangeUni : changed conditional boundary → NO_COVERAGE 2. addRangeUni : negated conditional → NO_COVERAGE 3. addRangeUni : negated conditional → NO_COVERAGE 4. addRangeUni : negated conditional → NO_COVERAGE |
if (!subsetp && (subsetRanges != null || directoryOffset > 0)) { |
1207 |
3
1. addRangeUni : changed conditional boundary → NO_COVERAGE 2. addRangeUni : negated conditional → NO_COVERAGE 3. addRangeUni : negated conditional → NO_COVERAGE |
int[] rg = (subsetRanges == null && directoryOffset > 0) ? new int[]{0, 0xffff} : compactRanges(subsetRanges); |
1208 | HashMap usemap; | |
1209 |
2
1. addRangeUni : negated conditional → NO_COVERAGE 2. addRangeUni : negated conditional → NO_COVERAGE |
if (!fontSpecific && cmap31 != null) |
1210 | usemap = cmap31; | |
1211 |
2
1. addRangeUni : negated conditional → NO_COVERAGE 2. addRangeUni : negated conditional → NO_COVERAGE |
else if (fontSpecific && cmap10 != null) |
1212 | usemap = cmap10; | |
1213 |
1
1. addRangeUni : negated conditional → NO_COVERAGE |
else if (cmap31 != null) |
1214 | usemap = cmap31; | |
1215 | else | |
1216 | usemap = cmap10; | |
1217 | for (Object o : usemap.entrySet()) { | |
1218 | Map.Entry e = (Map.Entry) o; | |
1219 | int[] v = (int[]) e.getValue(); | |
1220 | Integer gi = v[0]; | |
1221 |
1
1. addRangeUni : negated conditional → NO_COVERAGE |
if (longTag.containsKey(gi)) |
1222 | continue; | |
1223 | int c = (Integer) e.getKey(); | |
1224 | boolean skip = true; | |
1225 |
3
1. addRangeUni : changed conditional boundary → NO_COVERAGE 2. addRangeUni : Changed increment from 2 to -2 → NO_COVERAGE 3. addRangeUni : negated conditional → NO_COVERAGE |
for (int k = 0; k < rg.length; k += 2) { |
1226 |
5
1. addRangeUni : changed conditional boundary → NO_COVERAGE 2. addRangeUni : changed conditional boundary → NO_COVERAGE 3. addRangeUni : Replaced integer addition with subtraction → NO_COVERAGE 4. addRangeUni : negated conditional → NO_COVERAGE 5. addRangeUni : negated conditional → NO_COVERAGE |
if (c >= rg[k] && c <= rg[k + 1]) { |
1227 | skip = false; | |
1228 | break; | |
1229 | } | |
1230 | } | |
1231 |
1
1. addRangeUni : negated conditional → NO_COVERAGE |
if (!skip) |
1232 |
1
1. addRangeUni : negated conditional → NO_COVERAGE |
longTag.put(gi, includeMetrics ? new int[]{v[0], v[1], c} : null); |
1233 | } | |
1234 | } | |
1235 | } | |
1236 | | |
1237 | /** Outputs to the writer the font dictionaries and streams. | |
1238 | * @param writer the writer for this document | |
1239 | * @param ref the font indirect reference | |
1240 | * @param params several parameters that depend on the font type | |
1241 | * @throws IOException on error | |
1242 | * @throws DocumentException error in generating the object | |
1243 | */ | |
1244 | void writeFont(PdfWriter writer, PdfIndirectReference ref, Object[] params) throws DocumentException, IOException { | |
1245 | int firstChar = (Integer) params[0]; | |
1246 | int lastChar = (Integer) params[1]; | |
1247 | byte[] shortTag = (byte[]) params[2]; | |
1248 |
2
1. writeFont : negated conditional → NO_COVERAGE 2. writeFont : negated conditional → NO_COVERAGE |
boolean subsetp = (Boolean) params[3] && subset; |
1249 | | |
1250 |
1
1. writeFont : negated conditional → NO_COVERAGE |
if (!subsetp) { |
1251 | firstChar = 0; | |
1252 |
1
1. writeFont : Replaced integer subtraction with addition → NO_COVERAGE |
lastChar = shortTag.length - 1; |
1253 |
2
1. writeFont : changed conditional boundary → NO_COVERAGE 2. writeFont : negated conditional → NO_COVERAGE |
for (int k = 0; k < shortTag.length; ++k) |
1254 | shortTag[k] = 1; | |
1255 | } | |
1256 | PdfIndirectReference ind_font = null; | |
1257 | PdfObject pobj = null; | |
1258 | PdfIndirectObject obj = null; | |
1259 | String subsetPrefix = ""; | |
1260 |
1
1. writeFont : negated conditional → NO_COVERAGE |
if (embedded) { |
1261 |
1
1. writeFont : negated conditional → NO_COVERAGE |
if (cff) { |
1262 | pobj = new StreamFont(readCffFont(), "Type1C", compressionLevel); | |
1263 | obj = writer.addToBody(pobj); | |
1264 | ind_font = obj.getIndirectReference(); | |
1265 | } | |
1266 | else { | |
1267 |
1
1. writeFont : negated conditional → NO_COVERAGE |
if (subsetp) |
1268 | subsetPrefix = createSubsetPrefix(); | |
1269 | HashMap glyphs = new HashMap(); | |
1270 |
3
1. writeFont : changed conditional boundary → NO_COVERAGE 2. writeFont : Changed increment from 1 to -1 → NO_COVERAGE 3. writeFont : negated conditional → NO_COVERAGE |
for (int k = firstChar; k <= lastChar; ++k) { |
1271 |
1
1. writeFont : negated conditional → NO_COVERAGE |
if (shortTag[k] != 0) { |
1272 | int[] metrics = null; | |
1273 |
1
1. writeFont : negated conditional → NO_COVERAGE |
if (specialMap != null) { |
1274 | int[] cd = GlyphList.nameToUnicode(differences[k]); | |
1275 |
1
1. writeFont : negated conditional → NO_COVERAGE |
if (cd != null) |
1276 | metrics = getMetricsTT(cd[0]); | |
1277 | } | |
1278 | else { | |
1279 |
1
1. writeFont : negated conditional → NO_COVERAGE |
if (fontSpecific) |
1280 | metrics = getMetricsTT(k); | |
1281 | else | |
1282 | metrics = getMetricsTT(unicodeDifferences[k]); | |
1283 | } | |
1284 |
1
1. writeFont : negated conditional → NO_COVERAGE |
if (metrics != null) |
1285 | glyphs.put(metrics[0], null); | |
1286 | } | |
1287 | } | |
1288 |
1
1. writeFont : removed call to com/lowagie/text/pdf/TrueTypeFont::addRangeUni → NO_COVERAGE |
addRangeUni(glyphs, false, subsetp); |
1289 | byte[] b = null; | |
1290 |
3
1. writeFont : negated conditional → NO_COVERAGE 2. writeFont : negated conditional → NO_COVERAGE 3. writeFont : negated conditional → NO_COVERAGE |
if (subsetp || directoryOffset != 0 || subsetRanges != null) { |
1291 |
1
1. writeFont : negated conditional → NO_COVERAGE |
TrueTypeFontSubSet sb = new TrueTypeFontSubSet(fileName, new RandomAccessFileOrArray(rf), glyphs, directoryOffset, true, !subsetp); |
1292 | b = sb.process(); | |
1293 | } | |
1294 | else { | |
1295 | b = getFullFont(); | |
1296 | } | |
1297 | int[] lengths = new int[]{b.length}; | |
1298 | pobj = new StreamFont(b, lengths, compressionLevel); | |
1299 | obj = writer.addToBody(pobj); | |
1300 | ind_font = obj.getIndirectReference(); | |
1301 | } | |
1302 | } | |
1303 | pobj = getFontDescriptor(ind_font, subsetPrefix, null); | |
1304 |
1
1. writeFont : negated conditional → NO_COVERAGE |
if (pobj != null){ |
1305 | obj = writer.addToBody(pobj); | |
1306 | ind_font = obj.getIndirectReference(); | |
1307 | } | |
1308 | pobj = getFontBaseType(ind_font, subsetPrefix, firstChar, lastChar, shortTag); | |
1309 | writer.addToBody(pobj, ref); | |
1310 | } | |
1311 | | |
1312 | /** | |
1313 | * If this font file is using the Compact Font File Format, then this method | |
1314 | * will return the raw bytes needed for the font stream. If this method is | |
1315 | * ever made public: make sure to add a test if (cff == true). | |
1316 | * @return a byte array | |
1317 | * @since 2.1.3 | |
1318 | */ | |
1319 | protected byte[] readCffFont() throws IOException { | |
1320 | RandomAccessFileOrArray rf2 = new RandomAccessFileOrArray(rf); | |
1321 | byte[] b = new byte[cffLength]; | |
1322 | try { | |
1323 |
1
1. readCffFont : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::reOpen → NO_COVERAGE |
rf2.reOpen(); |
1324 |
1
1. readCffFont : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE |
rf2.seek(cffOffset); |
1325 |
1
1. readCffFont : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::readFully → NO_COVERAGE |
rf2.readFully(b); |
1326 | } | |
1327 | finally { | |
1328 | try { | |
1329 |
1
1. readCffFont : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::close → NO_COVERAGE |
rf2.close(); |
1330 | } | |
1331 | catch (Exception e) { | |
1332 | // empty on purpose | |
1333 | } | |
1334 | } | |
1335 |
1
1. readCffFont : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::readCffFont to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return b; |
1336 | } | |
1337 | ||
1338 | /** | |
1339 | * Returns a PdfStream object with the full font program. | |
1340 | * @return a PdfStream with the font program | |
1341 | * @since 2.1.3 | |
1342 | */ | |
1343 | public PdfStream getFullFontStream() throws IOException, DocumentException { | |
1344 |
1
1. getFullFontStream : negated conditional → NO_COVERAGE |
if (cff) { |
1345 |
1
1. getFullFontStream : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getFullFontStream to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return new StreamFont(readCffFont(), "Type1C", compressionLevel); |
1346 | } | |
1347 | else { | |
1348 | byte[] b = getFullFont(); | |
1349 | int[] lengths = new int[]{b.length}; | |
1350 |
1
1. getFullFontStream : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getFullFontStream to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return new StreamFont(b, lengths, compressionLevel); |
1351 | } | |
1352 | } | |
1353 | | |
1354 | /** Gets the font parameter identified by <CODE>key</CODE>. Valid values | |
1355 | * for <CODE>key</CODE> are <CODE>ASCENT</CODE>, <CODE>CAPHEIGHT</CODE>, <CODE>DESCENT</CODE> | |
1356 | * and <CODE>ITALICANGLE</CODE>. | |
1357 | * @param key the parameter to be extracted | |
1358 | * @param fontSize the font size in points | |
1359 | * @return the parameter in points | |
1360 | */ | |
1361 | public float getFontDescriptor(int key, float fontSize) { | |
1362 | switch (key) { | |
1363 | case ASCENT: | |
1364 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return os_2.sTypoAscender * fontSize / head.unitsPerEm; |
1365 | case CAPHEIGHT: | |
1366 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return os_2.sCapHeight * fontSize / head.unitsPerEm; |
1367 | case DESCENT: | |
1368 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return os_2.sTypoDescender * fontSize / head.unitsPerEm; |
1369 | case ITALICANGLE: | |
1370 |
1
1. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return (float)italicAngle; |
1371 | case BBOXLLX: | |
1372 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return fontSize * head.xMin / head.unitsPerEm; |
1373 | case BBOXLLY: | |
1374 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return fontSize * head.yMin / head.unitsPerEm; |
1375 | case BBOXURX: | |
1376 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return fontSize * head.xMax / head.unitsPerEm; |
1377 | case BBOXURY: | |
1378 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return fontSize * head.yMax / head.unitsPerEm; |
1379 | case AWT_ASCENT: | |
1380 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return fontSize * hhea.Ascender / head.unitsPerEm; |
1381 | case AWT_DESCENT: | |
1382 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return fontSize * hhea.Descender / head.unitsPerEm; |
1383 | case AWT_LEADING: | |
1384 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return fontSize * hhea.LineGap / head.unitsPerEm; |
1385 | case AWT_MAXADVANCE: | |
1386 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return fontSize * hhea.advanceWidthMax / head.unitsPerEm; |
1387 | case UNDERLINE_POSITION: | |
1388 |
5
1. getFontDescriptor : Replaced integer division with multiplication → NO_COVERAGE 2. getFontDescriptor : Replaced integer subtraction with addition → NO_COVERAGE 3. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 4. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 5. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return (underlinePosition - underlineThickness / 2) * fontSize / head.unitsPerEm; |
1389 | case UNDERLINE_THICKNESS: | |
1390 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return underlineThickness * fontSize / head.unitsPerEm; |
1391 | case STRIKETHROUGH_POSITION: | |
1392 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return os_2.yStrikeoutPosition * fontSize / head.unitsPerEm; |
1393 | case STRIKETHROUGH_THICKNESS: | |
1394 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return os_2.yStrikeoutSize * fontSize / head.unitsPerEm; |
1395 | case SUBSCRIPT_SIZE: | |
1396 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return os_2.ySubscriptYSize * fontSize / head.unitsPerEm; |
1397 | case SUBSCRIPT_OFFSET: | |
1398 |
4
1. getFontDescriptor : removed negation → NO_COVERAGE 2. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 3. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 4. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return -os_2.ySubscriptYOffset * fontSize / head.unitsPerEm; |
1399 | case SUPERSCRIPT_SIZE: | |
1400 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return os_2.ySuperscriptYSize * fontSize / head.unitsPerEm; |
1401 | case SUPERSCRIPT_OFFSET: | |
1402 |
3
1. getFontDescriptor : Replaced float multiplication with division → NO_COVERAGE 2. getFontDescriptor : Replaced float division with multiplication → NO_COVERAGE 3. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return os_2.ySuperscriptYOffset * fontSize / head.unitsPerEm; |
1403 | } | |
1404 |
1
1. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/TrueTypeFont::getFontDescriptor → NO_COVERAGE |
return 0; |
1405 | } | |
1406 | | |
1407 | /** Gets the glyph index and metrics for a character. | |
1408 | * @param c the character | |
1409 | * @return an <CODE>int</CODE> array with {glyph index, width} | |
1410 | */ | |
1411 | public int[] getMetricsTT(int c) { | |
1412 |
1
1. getMetricsTT : negated conditional → NO_COVERAGE |
if (cmapExt != null) |
1413 |
1
1. getMetricsTT : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (int[])cmapExt.get(c); |
1414 |
2
1. getMetricsTT : negated conditional → NO_COVERAGE 2. getMetricsTT : negated conditional → NO_COVERAGE |
if (!fontSpecific && cmap31 != null) |
1415 |
1
1. getMetricsTT : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (int[])cmap31.get(c); |
1416 |
2
1. getMetricsTT : negated conditional → NO_COVERAGE 2. getMetricsTT : negated conditional → NO_COVERAGE |
if (fontSpecific && cmap10 != null) |
1417 |
1
1. getMetricsTT : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (int[])cmap10.get(c); |
1418 |
1
1. getMetricsTT : negated conditional → NO_COVERAGE |
if (cmap31 != null) |
1419 |
1
1. getMetricsTT : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (int[])cmap31.get(c); |
1420 |
1
1. getMetricsTT : negated conditional → NO_COVERAGE |
if (cmap10 != null) |
1421 |
1
1. getMetricsTT : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return (int[])cmap10.get(c); |
1422 |
1
1. getMetricsTT : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return null; |
1423 | } | |
1424 | ||
1425 | /** Gets the postscript font name. | |
1426 | * @return the postscript font name | |
1427 | */ | |
1428 | public String getPostscriptFontName() { | |
1429 | return fontName; | |
1430 | } | |
1431 | ||
1432 | /** Gets the code pages supported by the font. | |
1433 | * @return the code pages supported by the font | |
1434 | */ | |
1435 | public String[] getCodePagesSupported() { | |
1436 |
3
1. getCodePagesSupported : Replaced Shift Left with Shift Right → NO_COVERAGE 2. getCodePagesSupported : Replaced bitwise AND with OR → NO_COVERAGE 3. getCodePagesSupported : Replaced long addition with subtraction → NO_COVERAGE |
long cp = (((long)os_2.ulCodePageRange2) << 32) + (os_2.ulCodePageRange1 & 0xffffffffL); |
1437 | int count = 0; | |
1438 | long bit = 1; | |
1439 |
2
1. getCodePagesSupported : changed conditional boundary → NO_COVERAGE 2. getCodePagesSupported : negated conditional → NO_COVERAGE |
for (int k = 0; k < 64; ++k) { |
1440 |
3
1. getCodePagesSupported : Replaced bitwise AND with OR → NO_COVERAGE 2. getCodePagesSupported : negated conditional → NO_COVERAGE 3. getCodePagesSupported : negated conditional → NO_COVERAGE |
if ((cp & bit) != 0 && codePages[k] != null) |
1441 |
1
1. getCodePagesSupported : Changed increment from 1 to -1 → NO_COVERAGE |
++count; |
1442 |
1
1. getCodePagesSupported : Replaced Shift Left with Shift Right → NO_COVERAGE |
bit <<= 1; |
1443 | } | |
1444 | String[] ret = new String[count]; | |
1445 | count = 0; | |
1446 | bit = 1; | |
1447 |
2
1. getCodePagesSupported : changed conditional boundary → NO_COVERAGE 2. getCodePagesSupported : negated conditional → NO_COVERAGE |
for (int k = 0; k < 64; ++k) { |
1448 |
3
1. getCodePagesSupported : Replaced bitwise AND with OR → NO_COVERAGE 2. getCodePagesSupported : negated conditional → NO_COVERAGE 3. getCodePagesSupported : negated conditional → NO_COVERAGE |
if ((cp & bit) != 0 && codePages[k] != null) |
1449 |
1
1. getCodePagesSupported : Changed increment from 1 to -1 → NO_COVERAGE |
ret[count++] = codePages[k]; |
1450 |
1
1. getCodePagesSupported : Replaced Shift Left with Shift Right → NO_COVERAGE |
bit <<= 1; |
1451 | } | |
1452 |
1
1. getCodePagesSupported : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getCodePagesSupported to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return ret; |
1453 | } | |
1454 | | |
1455 | /** Gets the full name of the font. If it is a True Type font | |
1456 | * each array element will have {Platform ID, Platform Encoding ID, | |
1457 | * Language ID, font name}. The interpretation of this values can be | |
1458 | * found in the Open Type specification, chapter 2, in the 'name' table.<br> | |
1459 | * For the other fonts the array has a single element with {"", "", "", | |
1460 | * font name}. | |
1461 | * @return the full name of the font | |
1462 | */ | |
1463 | public String[][] getFullFontName() { | |
1464 | return fullName; | |
1465 | } | |
1466 | | |
1467 | /** Gets all the entries of the Names-Table. If it is a True Type font | |
1468 | * each array element will have {Name ID, Platform ID, Platform Encoding ID, | |
1469 | * Language ID, font name}. The interpretation of this values can be | |
1470 | * found in the Open Type specification, chapter 2, in the 'name' table.<br> | |
1471 | * For the other fonts the array has a single element with {"", "", "", | |
1472 | * font name}. | |
1473 | * @return the full name of the font | |
1474 | */ | |
1475 | public String[][] getAllNameEntries() { | |
1476 | return allNameEntries; | |
1477 | } | |
1478 | | |
1479 | /** Gets the family name of the font. If it is a True Type font | |
1480 | * each array element will have {Platform ID, Platform Encoding ID, | |
1481 | * Language ID, font name}. The interpretation of this values can be | |
1482 | * found in the Open Type specification, chapter 2, in the 'name' table.<br> | |
1483 | * For the other fonts the array has a single element with {"", "", "", | |
1484 | * font name}. | |
1485 | * @return the family name of the font | |
1486 | */ | |
1487 | public String[][] getFamilyFontName() { | |
1488 | return familyName; | |
1489 | } | |
1490 | | |
1491 | /** Checks if the font has any kerning pairs. | |
1492 | * @return <CODE>true</CODE> if the font has any kerning pairs | |
1493 | */ | |
1494 | public boolean hasKernPairs() { | |
1495 |
3
1. hasKernPairs : changed conditional boundary → NO_COVERAGE 2. hasKernPairs : negated conditional → NO_COVERAGE 3. hasKernPairs : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return kerning.size() > 0; |
1496 | } | |
1497 | | |
1498 | /** | |
1499 | * Sets the font name that will appear in the pdf font dictionary. | |
1500 | * Use with care as it can easily make a font unreadable if not embedded. | |
1501 | * @param name the new font name | |
1502 | */ | |
1503 | public void setPostscriptFontName(String name) { | |
1504 | fontName = name; | |
1505 | } | |
1506 | | |
1507 | /** | |
1508 | * Sets the kerning between two Unicode chars. | |
1509 | * @param char1 the first char | |
1510 | * @param char2 the second char | |
1511 | * @param kern the kerning to apply in normalized 1000 units | |
1512 | * @return <code>true</code> if the kerning was applied, <code>false</code> otherwise | |
1513 | */ | |
1514 | public boolean setKerning(int char1, int char2, int kern) { | |
1515 | int[] metrics = getMetricsTT(char1); | |
1516 |
1
1. setKerning : negated conditional → NO_COVERAGE |
if (metrics == null) |
1517 |
1
1. setKerning : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return false; |
1518 | int c1 = metrics[0]; | |
1519 | metrics = getMetricsTT(char2); | |
1520 |
1
1. setKerning : negated conditional → NO_COVERAGE |
if (metrics == null) |
1521 |
1
1. setKerning : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return false; |
1522 | int c2 = metrics[0]; | |
1523 |
2
1. setKerning : Replaced Shift Left with Shift Right → NO_COVERAGE 2. setKerning : Replaced integer addition with subtraction → NO_COVERAGE |
kerning.put((c1 << 16) + c2, kern); |
1524 |
1
1. setKerning : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return true; |
1525 | } | |
1526 | | |
1527 | protected int[] getRawCharBBox(int c, String name) { | |
1528 | HashMap map = null; | |
1529 |
2
1. getRawCharBBox : negated conditional → NO_COVERAGE 2. getRawCharBBox : negated conditional → NO_COVERAGE |
if (name == null || cmap31 == null) |
1530 | map = cmap10; | |
1531 | else | |
1532 | map = cmap31; | |
1533 |
1
1. getRawCharBBox : negated conditional → NO_COVERAGE |
if (map == null) |
1534 |
1
1. getRawCharBBox : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getRawCharBBox to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return null; |
1535 | int[] metric = (int[]) map.get(c); | |
1536 |
2
1. getRawCharBBox : negated conditional → NO_COVERAGE 2. getRawCharBBox : negated conditional → NO_COVERAGE |
if (metric == null || bboxes == null) |
1537 |
1
1. getRawCharBBox : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getRawCharBBox to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return null; |
1538 |
1
1. getRawCharBBox : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFont::getRawCharBBox to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return bboxes[metric[0]]; |
1539 | } | |
1540 | } | |
Mutations | ||
374 |
1.1 2.2 |
|
382 |
1.1 2.2 |
|
383 |
1.1 |
|
384 |
1.1 2.2 3.3 |
|
385 |
1.1 |
|
386 |
1.1 2.2 3.3 |
|
391 |
1.1 |
|
393 |
1.1 |
|
404 |
1.1 2.2 |
|
405 |
1.1 |
|
407 |
1.1 2.2 |
|
419 |
1.1 |
|
421 |
1.1 2.2 |
|
432 |
1.1 |
|
434 |
1.1 2.2 |
|
448 |
1.1 |
|
450 |
1.1 |
|
467 |
1.1 |
|
469 |
1.1 |
|
475 |
1.1 2.2 |
|
476 |
1.1 |
|
482 |
1.1 2.2 |
|
486 |
1.1 2.2 |
|
491 |
1.1 |
|
494 |
1.1 |
|
495 |
1.1 2.2 3.3 |
|
498 |
1.1 2.2 |
|
501 |
1.1 2.2 |
|
504 |
1.1 |
|
516 |
1.1 |
|
518 |
1.1 2.2 |
|
521 |
1.1 2.2 3.3 |
|
528 |
1.1 |
|
529 |
1.1 2.2 3.3 |
|
530 |
1.1 2.2 |
|
531 |
1.1 |
|
533 |
1.1 |
|
537 |
1.1 |
|
548 |
1.1 |
|
550 |
1.1 2.2 |
|
554 |
1.1 2.2 3.3 |
|
561 |
1.1 |
|
563 |
1.1 2.2 3.3 |
|
565 |
1.1 2.2 3.3 4.4 |
|
573 |
1.1 |
|
577 |
1.1 2.2 |
|
579 |
1.1 |
|
589 |
1.1 |
|
591 |
1.1 2.2 |
|
595 |
1.1 2.2 3.3 |
|
603 |
1.1 2.2 3.3 |
|
605 |
1.1 2.2 3.3 4.4 |
|
613 |
1.1 |
|
616 |
1.1 2.2 |
|
618 |
1.1 |
|
624 |
1.1 |
|
641 |
1.1 |
|
645 |
1.1 2.2 |
|
647 |
1.1 2.2 |
|
650 |
1.1 |
|
654 |
1.1 2.2 |
|
655 |
1.1 |
|
656 |
1.1 |
|
659 |
1.1 |
|
661 |
1.1 2.2 |
|
665 |
1.1 2.2 3.3 |
|
673 |
1.1 |
|
678 |
1.1 |
|
679 |
1.1 |
|
680 |
1.1 |
|
681 |
1.1 |
|
682 |
1.1 |
|
683 |
1.1 |
|
687 |
1.1 |
|
688 |
1.1 |
|
689 |
1.1 |
|
703 |
1.1 |
|
705 |
1.1 |
|
721 |
1.1 |
|
722 |
1.1 2.2 3.3 |
|
725 |
1.1 |
|
736 |
1.1 |
|
738 |
1.1 |
|
740 |
1.1 2.2 3.3 |
|
741 |
1.1 2.2 |
|
751 |
1.1 2.2 |
|
752 |
1.1 |
|
753 |
1.1 |
|
759 |
1.1 |
|
761 |
1.1 2.2 |
|
762 |
1.1 |
|
764 |
1.1 |
|
766 |
1.1 |
|
768 |
1.1 |
|
769 |
1.1 |
|
771 |
1.1 2.2 3.3 |
|
772 |
1.1 |
|
775 |
1.1 |
|
777 |
1.1 2.2 3.3 |
|
781 |
1.1 |
|
784 |
1.1 |
|
785 |
1.1 2.2 3.3 4.4 |
|
787 |
1.1 2.2 |
|
788 |
1.1 2.2 3.3 |
|
790 |
1.1 2.2 |
|
791 |
1.1 2.2 |
|
792 |
1.1 2.2 |
|
793 |
1.1 2.2 |
|
806 |
1.1 |
|
808 |
1.1 |
|
816 |
1.1 2.2 3.3 |
|
820 |
1.1 2.2 |
|
824 |
1.1 2.2 |
|
827 |
1.1 2.2 |
|
830 |
1.1 2.2 |
|
834 |
1.1 2.2 |
|
835 |
1.1 2.2 |
|
849 |
1.1 2.2 |
|
850 |
1.1 2.2 |
|
852 |
1.1 |
|
856 |
1.1 2.2 |
|
857 |
1.1 2.2 |
|
859 |
1.1 |
|
863 |
1.1 2.2 |
|
864 |
1.1 2.2 |
|
889 |
1.1 2.2 3.3 |
|
893 |
1.1 2.2 3.3 |
|
898 |
1.1 |
|
901 |
1.1 |
|
912 |
1.1 2.2 3.3 |
|
918 |
1.1 |
|
930 |
1.1 |
|
933 |
1.1 2.2 3.3 |
|
938 |
1.1 2.2 3.3 |
|
942 |
1.1 2.2 3.3 |
|
946 |
1.1 2.2 3.3 |
|
949 |
1.1 2.2 3.3 4.4 |
|
950 |
1.1 2.2 |
|
953 |
1.1 2.2 3.3 |
|
955 |
1.1 2.2 3.3 4.4 |
|
956 |
1.1 |
|
957 |
1.1 2.2 |
|
960 |
1.1 2.2 3.3 4.4 5.5 |
|
961 |
1.1 2.2 |
|
963 |
1.1 2.2 |
|
968 |
1.1 2.2 3.3 4.4 |
|
971 |
1.1 |
|
985 |
1.1 2.2 3.3 |
|
989 |
1.1 |
|
991 |
1.1 |
|
1000 |
1.1 |
|
1002 |
1.1 2.2 |
|
1004 |
1.1 |
|
1006 |
1.1 2.2 3.3 |
|
1007 |
1.1 |
|
1008 |
1.1 |
|
1012 |
1.1 2.2 |
|
1015 |
1.1 2.2 3.3 |
|
1017 |
1.1 2.2 |
|
1031 |
1.1 |
|
1032 |
1.1 |
|
1035 |
1.1 |
|
1036 |
1.1 |
|
1038 |
1.1 2.2 3.3 |
|
1049 |
1.1 |
|
1050 |
1.1 |
|
1051 |
1.1 |
|
1061 |
1.1 2.2 3.3 |
|
1062 |
1.1 2.2 3.3 |
|
1063 |
1.1 2.2 3.3 |
|
1064 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 |
|
1069 |
1.1 |
|
1070 |
1.1 |
|
1071 |
1.1 |
|
1072 |
1.1 |
|
1073 |
1.1 |
|
1075 |
1.1 |
|
1078 |
1.1 |
|
1079 |
1.1 |
|
1080 |
1.1 |
|
1081 |
1.1 |
|
1082 |
1.1 |
|
1083 |
1.1 |
|
1085 |
1.1 |
|
1088 |
1.1 |
|
1089 |
1.1 |
|
1090 |
1.1 2.2 |
|
1091 |
1.1 2.2 |
|
1092 |
1.1 |
|
1093 |
1.1 2.2 |
|
1094 |
1.1 |
|
1095 |
1.1 |
|
1097 |
1.1 |
|
1110 |
1.1 |
|
1111 |
1.1 |
|
1112 |
1.1 |
|
1115 |
1.1 |
|
1116 |
1.1 |
|
1118 |
1.1 |
|
1119 |
1.1 |
|
1120 |
1.1 2.2 3.3 |
|
1121 |
1.1 |
|
1126 |
1.1 2.2 |
|
1127 |
1.1 2.2 |
|
1132 |
1.1 2.2 3.3 |
|
1133 |
1.1 |
|
1134 |
1.1 |
|
1143 |
1.1 |
|
1144 |
1.1 |
|
1147 |
1.1 |
|
1148 |
1.1 |
|
1150 |
1.1 2.2 3.3 |
|
1151 |
1.1 |
|
1156 |
1.1 |
|
1157 |
1.1 |
|
1158 |
1.1 |
|
1159 |
1.1 |
|
1166 |
1.1 |
|
1168 |
1.1 |
|
1169 |
1.1 |
|
1172 |
1.1 2.2 |
|
1180 |
1.1 2.2 |
|
1181 |
1.1 2.2 |
|
1184 |
1.1 2.2 3.3 4.4 |
|
1185 |
1.1 2.2 3.3 |
|
1188 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 |
|
1192 |
1.1 |
|
1196 |
1.1 |
|
1197 |
1.1 2.2 |
|
1199 |
1.1 |
|
1200 |
1.1 2.2 |
|
1202 |
1.1 |
|
1206 |
1.1 2.2 3.3 4.4 |
|
1207 |
1.1 2.2 3.3 |
|
1209 |
1.1 2.2 |
|
1211 |
1.1 2.2 |
|
1213 |
1.1 |
|
1221 |
1.1 |
|
1225 |
1.1 2.2 3.3 |
|
1226 |
1.1 2.2 3.3 4.4 5.5 |
|
1231 |
1.1 |
|
1232 |
1.1 |
|
1248 |
1.1 2.2 |
|
1250 |
1.1 |
|
1252 |
1.1 |
|
1253 |
1.1 2.2 |
|
1260 |
1.1 |
|
1261 |
1.1 |
|
1267 |
1.1 |
|
1270 |
1.1 2.2 3.3 |
|
1271 |
1.1 |
|
1273 |
1.1 |
|
1275 |
1.1 |
|
1279 |
1.1 |
|
1284 |
1.1 |
|
1288 |
1.1 |
|
1290 |
1.1 2.2 3.3 |
|
1291 |
1.1 |
|
1304 |
1.1 |
|
1323 |
1.1 |
|
1324 |
1.1 |
|
1325 |
1.1 |
|
1329 |
1.1 |
|
1335 |
1.1 |
|
1344 |
1.1 |
|
1345 |
1.1 |
|
1350 |
1.1 |
|
1364 |
1.1 2.2 3.3 |
|
1366 |
1.1 2.2 3.3 |
|
1368 |
1.1 2.2 3.3 |
|
1370 |
1.1 |
|
1372 |
1.1 2.2 3.3 |
|
1374 |
1.1 2.2 3.3 |
|
1376 |
1.1 2.2 3.3 |
|
1378 |
1.1 2.2 3.3 |
|
1380 |
1.1 2.2 3.3 |
|
1382 |
1.1 2.2 3.3 |
|
1384 |
1.1 2.2 3.3 |
|
1386 |
1.1 2.2 3.3 |
|
1388 |
1.1 2.2 3.3 4.4 5.5 |
|
1390 |
1.1 2.2 3.3 |
|
1392 |
1.1 2.2 3.3 |
|
1394 |
1.1 2.2 3.3 |
|
1396 |
1.1 2.2 3.3 |
|
1398 |
1.1 2.2 3.3 4.4 |
|
1400 |
1.1 2.2 3.3 |
|
1402 |
1.1 2.2 3.3 |
|
1404 |
1.1 |
|
1412 |
1.1 |
|
1413 |
1.1 |
|
1414 |
1.1 2.2 |
|
1415 |
1.1 |
|
1416 |
1.1 2.2 |
|
1417 |
1.1 |
|
1418 |
1.1 |
|
1419 |
1.1 |
|
1420 |
1.1 |
|
1421 |
1.1 |
|
1422 |
1.1 |
|
1436 |
1.1 2.2 3.3 |
|
1439 |
1.1 2.2 |
|
1440 |
1.1 2.2 3.3 |
|
1441 |
1.1 |
|
1442 |
1.1 |
|
1447 |
1.1 2.2 |
|
1448 |
1.1 2.2 3.3 |
|
1449 |
1.1 |
|
1450 |
1.1 |
|
1452 |
1.1 |
|
1495 |
1.1 2.2 3.3 |
|
1516 |
1.1 |
|
1517 |
1.1 |
|
1520 |
1.1 |
|
1521 |
1.1 |
|
1523 |
1.1 2.2 |
|
1524 |
1.1 |
|
1529 |
1.1 2.2 |
|
1533 |
1.1 |
|
1534 |
1.1 |
|
1536 |
1.1 2.2 |
|
1537 |
1.1 |
|
1538 |
1.1 |