TrueTypeFontUnicode.java

1
/*
2
 * $Id: TrueTypeFontUnicode.java 4065 2009-09-16 23:09:11Z psoares33 $
3
 *
4
 * Copyright 2001, 2002 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.IOException;
53
import java.util.ArrayList;
54
import java.util.Arrays;
55
import java.util.Comparator;
56
import java.util.HashMap;
57
import java.util.List;
58
import java.util.Map;
59
60
import com.lowagie.text.DocumentException;
61
import com.lowagie.text.Utilities;
62
import com.lowagie.text.error_messages.MessageLocalization;
63
64
/** Represents a True Type font with Unicode encoding. All the character
65
 * in the font can be used directly by using the encoding Identity-H or
66
 * Identity-V. This is the only way to represent some character sets such
67
 * as Thai.
68
 * @author  Paulo Soares (psoares@consiste.pt)
69
 */
70
class TrueTypeFontUnicode extends TrueTypeFont implements Comparator{
71
    
72
    /**
73
     * <CODE>true</CODE> if the encoding is vertical.
74
     */    
75
    boolean vertical = false;
76
    
77
    Map<Integer, Integer> inverseCmap;
78
    
79
    /**
80
     * Creates a new TrueType font addressed by Unicode characters. The font
81
     * will always be embedded.
82
     * @param ttFile the location of the font on file. The file must end in '.ttf'.
83
     * The modifiers after the name are ignored.
84
     * @param enc the encoding to be applied to this font
85
     * @param emb true if the font is to be embedded in the PDF
86
     * @param ttfAfm the font as a <CODE>byte</CODE> array
87
     * @throws DocumentException the font is invalid
88
     * @throws IOException the font file could not be read
89
     */
90
    TrueTypeFontUnicode(String ttFile, String enc, boolean emb, byte[] ttfAfm, boolean forceRead) throws DocumentException, IOException {
91
        String nameBase = getBaseName(ttFile);
92
        String ttcName = getTTCName(nameBase);
93 2 1. : changed conditional boundary → NO_COVERAGE
2. : negated conditional → NO_COVERAGE
        if (nameBase.length() < ttFile.length()) {
94
            style = ttFile.substring(nameBase.length());
95
        }
96
        encoding = enc;
97
        embedded = emb;
98
        fileName = ttcName;
99
        ttcIndex = "";
100 2 1. : changed conditional boundary → NO_COVERAGE
2. : negated conditional → NO_COVERAGE
        if (ttcName.length() < nameBase.length())
101 1 1. : Replaced integer addition with subtraction → NO_COVERAGE
            ttcIndex = nameBase.substring(ttcName.length() + 1);
102
        fontType = FONT_TYPE_TTUNI;
103 6 1. : negated conditional → NO_COVERAGE
2. : negated conditional → NO_COVERAGE
3. : negated conditional → NO_COVERAGE
4. : negated conditional → NO_COVERAGE
5. : negated conditional → NO_COVERAGE
6. : negated conditional → NO_COVERAGE
        if ((fileName.toLowerCase().endsWith(".ttf") || fileName.toLowerCase().endsWith(".otf") || fileName.toLowerCase().endsWith(".ttc")) && ((enc.equals(IDENTITY_H) || enc.equals(IDENTITY_V)) && emb)) {
104 1 1. : removed call to com/lowagie/text/pdf/TrueTypeFontUnicode::process → NO_COVERAGE
            process(ttfAfm, forceRead);
105 1 1. : negated conditional → NO_COVERAGE
            if (os_2.fsType == 2)
106
                throw new DocumentException(MessageLocalization.getComposedMessage("1.cannot.be.embedded.due.to.licensing.restrictions", fileName + style));
107
            // Sivan
108 4 1. : negated conditional → NO_COVERAGE
2. : negated conditional → NO_COVERAGE
3. : negated conditional → NO_COVERAGE
4. : negated conditional → NO_COVERAGE
            if ((cmap31 == null && !fontSpecific) || (cmap10 == null && fontSpecific))
109
                directTextToByte=true;
110
                //throw new DocumentException(MessageLocalization.getComposedMessage("1.2.does.not.contain.an.usable.cmap", fileName, style));
111 1 1. : negated conditional → NO_COVERAGE
            if (fontSpecific) {
112
                fontSpecific = false;
113
                String tempEncoding = encoding;
114
                encoding = "";
115 1 1. : removed call to com/lowagie/text/pdf/TrueTypeFontUnicode::createEncoding → NO_COVERAGE
                createEncoding();
116
                encoding = tempEncoding;
117
                fontSpecific = true;
118
            }
119
        }
120
        else
121
            throw new DocumentException(MessageLocalization.getComposedMessage("1.2.is.not.a.ttf.font.file", fileName, style));
122
        vertical = enc.endsWith("V");
123
    }
124
    
125
    void readCMaps() throws DocumentException, IOException {
126 1 1. readCMaps : removed call to com/lowagie/text/pdf/TrueTypeFont::readCMaps → NO_COVERAGE
        super.readCMaps();
127
128
        Map cmap = null;
129 1 1. readCMaps : negated conditional → NO_COVERAGE
        if (cmapExt != null) {
130
            cmap = cmapExt;
131 1 1. readCMaps : negated conditional → NO_COVERAGE
        } else if (cmap31 != null) {
132
            cmap = cmap31;
133
        }
134
135 1 1. readCMaps : negated conditional → NO_COVERAGE
        if (cmap != null) {
136
            inverseCmap = new HashMap<>();
137
            for (Object o : cmap.entrySet()) {
138
                Map.Entry entry = (Map.Entry) o;
139
                Integer code = (Integer) entry.getKey();
140
                int[] metrics = (int[]) entry.getValue();
141
                inverseCmap.put(metrics[0], code);
142
            }
143
        }
144
    }
145
    
146
    protected Integer getCharacterCode(int code) {
147 2 1. getCharacterCode : negated conditional → NO_COVERAGE
2. getCharacterCode : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getCharacterCode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return inverseCmap == null ? null : inverseCmap.get(code);
148
    }
149
    
150
    
151
    /**
152
     * Gets the width of a <CODE>char</CODE> in normalized 1000 units.
153
     * @param char1 the unicode <CODE>char</CODE> to get the width of
154
     * @return the width in normalized 1000 units
155
     */
156
    public int getWidth(int char1) {
157 1 1. getWidth : negated conditional → NO_COVERAGE
        if (vertical)
158 1 1. getWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return 1000;
159 1 1. getWidth : negated conditional → NO_COVERAGE
        if (fontSpecific) {
160 4 1. getWidth : Replaced bitwise AND with OR → NO_COVERAGE
2. getWidth : Replaced bitwise AND with OR → NO_COVERAGE
3. getWidth : negated conditional → NO_COVERAGE
4. getWidth : negated conditional → NO_COVERAGE
            if ((char1 & 0xff00) == 0 || (char1 & 0xff00) == 0xf000)
161 2 1. getWidth : Replaced bitwise AND with OR → NO_COVERAGE
2. getWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
                return getRawWidth(char1 & 0xff, null);
162
            else
163 1 1. getWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
                return 0;
164
        }
165
        else {
166 1 1. getWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return getRawWidth(char1, encoding);
167
        }
168
    }
169
    
170
    /**
171
     * Gets the width of a <CODE>String</CODE> in normalized 1000 units.
172
     * @param text the <CODE>String</CODE> to get the width of
173
     * @return the width in normalized 1000 units
174
     */
175
    public int getWidth(String text) {
176 1 1. getWidth : negated conditional → NO_COVERAGE
        if (vertical)
177 2 1. getWidth : Replaced integer multiplication with division → NO_COVERAGE
2. getWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return text.length() * 1000;
178
        int total = 0;
179 1 1. getWidth : negated conditional → NO_COVERAGE
        if (fontSpecific) {
180
            char[] cc = text.toCharArray();
181
            int len = cc.length;
182
            for (char c : cc) {
183 4 1. getWidth : Replaced bitwise AND with OR → NO_COVERAGE
2. getWidth : Replaced bitwise AND with OR → NO_COVERAGE
3. getWidth : negated conditional → NO_COVERAGE
4. getWidth : negated conditional → NO_COVERAGE
                if ((c & 0xff00) == 0 || (c & 0xff00) == 0xf000)
184 2 1. getWidth : Replaced bitwise AND with OR → NO_COVERAGE
2. getWidth : Replaced integer addition with subtraction → NO_COVERAGE
                    total += getRawWidth(c & 0xff, null);
185
            }
186
        }
187
        else {
188
            int len = text.length();
189 3 1. getWidth : changed conditional boundary → NO_COVERAGE
2. getWidth : Changed increment from 1 to -1 → NO_COVERAGE
3. getWidth : negated conditional → NO_COVERAGE
            for (int k = 0; k < len; ++k) {
190 1 1. getWidth : negated conditional → NO_COVERAGE
                if (Utilities.isSurrogatePair(text, k)) {
191 1 1. getWidth : Replaced integer addition with subtraction → NO_COVERAGE
                    total += getRawWidth(Utilities.convertToUtf32(text, k), encoding);
192 1 1. getWidth : Changed increment from 1 to -1 → NO_COVERAGE
                    ++k;
193
                }
194
                else
195 1 1. getWidth : Replaced integer addition with subtraction → NO_COVERAGE
                    total += getRawWidth(text.charAt(k), encoding);
196
            }
197
        }
198 1 1. getWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return total;
199
    }
200
201
    /** Creates a ToUnicode CMap to allow copy and paste from Acrobat.
202
     * @param metrics metrics[0] contains the glyph index and metrics[2]
203
     * contains the Unicode code
204
     * @return the stream representing this CMap or <CODE>null</CODE>
205
     */    
206
    private PdfStream getToUnicode(Object[] metrics) {
207
        metrics = filterCmapMetrics(metrics);
208 1 1. getToUnicode : negated conditional → NO_COVERAGE
        if (metrics.length == 0)
209 1 1. getToUnicode : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getToUnicode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return null;
210
        StringBuilder buf = new StringBuilder(
211
        "/CIDInit /ProcSet findresource begin\n" +
212
        "12 dict begin\n" +
213
        "begincmap\n" +
214
        "/CIDSystemInfo\n" +
215
        "<< /Registry (TTX+0)\n" +
216
        "/Ordering (T42UV)\n" +
217
        "/Supplement 0\n" +
218
        ">> def\n" +
219
        "/CMapName /TTX+0 def\n" +
220
        "/CMapType 2 def\n" +
221
        "1 begincodespacerange\n" +
222
        "<0000><FFFF>\n" +
223
        "endcodespacerange\n");
224
        int size = 0;
225 3 1. getToUnicode : changed conditional boundary → NO_COVERAGE
2. getToUnicode : Changed increment from 1 to -1 → NO_COVERAGE
3. getToUnicode : negated conditional → NO_COVERAGE
        for (int k = 0; k < metrics.length; ++k) {
226 1 1. getToUnicode : negated conditional → NO_COVERAGE
            if (size == 0) {
227 1 1. getToUnicode : negated conditional → NO_COVERAGE
                if (k != 0) {
228
                    buf.append("endbfrange\n");
229
                }
230 1 1. getToUnicode : Replaced integer subtraction with addition → NO_COVERAGE
                size = Math.min(100, metrics.length - k);
231
                buf.append(size).append(" beginbfrange\n");
232
            }
233 1 1. getToUnicode : Changed increment from -1 to 1 → NO_COVERAGE
            --size;
234
            int[] metric = (int[]) metrics[k];
235
            String fromTo = toHex(metric[0]);
236
            buf.append(fromTo).append(fromTo).append(toHex(metric[2])).append('\n');
237
        }
238
        buf.append(
239
        "endbfrange\n" +
240
        "endcmap\n" +
241
        "CMapName currentdict /CMap defineresource pop\n" +
242
        "end end\n");
243
        String s = buf.toString();
244
        PdfStream stream = new PdfStream(PdfEncodings.convertToBytes(s, null));
245 1 1. getToUnicode : removed call to com/lowagie/text/pdf/PdfStream::flateCompress → NO_COVERAGE
        stream.flateCompress(compressionLevel);
246 1 1. getToUnicode : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getToUnicode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return stream;
247
    }
248
    
249
    private Object[] filterCmapMetrics(Object[] metrics) {
250 1 1. filterCmapMetrics : negated conditional → NO_COVERAGE
        if (metrics.length == 0) {
251 1 1. filterCmapMetrics : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::filterCmapMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return metrics;
252
        }
253
254
        List<int[]> cmapMetrics = new ArrayList<>(metrics.length);
255
        for (Object metric1 : metrics) {
256
            int[] metric = (int[]) metric1;
257
            // PdfContentByte.showText(GlyphVector) uses glyphs that might not
258
            // map to a character.
259
            // the glyphs are included in the metrics array, but we need to
260
            // exclude them from the cmap.
261 2 1. filterCmapMetrics : changed conditional boundary → NO_COVERAGE
2. filterCmapMetrics : negated conditional → NO_COVERAGE
            if (metric.length >= 3) {
262
                cmapMetrics.add(metric);
263
            }
264
        }
265
266 1 1. filterCmapMetrics : negated conditional → NO_COVERAGE
        if (cmapMetrics.size() == metrics.length) {
267 1 1. filterCmapMetrics : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::filterCmapMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return metrics;
268
        }
269
270 1 1. filterCmapMetrics : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::filterCmapMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return cmapMetrics.toArray();
271
    }
272
    
273
    private static String toHex4(int n) {
274
        String s = "0000" + Integer.toHexString(n);
275 2 1. toHex4 : Replaced integer subtraction with addition → NO_COVERAGE
2. toHex4 : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::toHex4 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return s.substring(s.length() - 4);
276
    }
277
    
278
    /** Gets an hex string in the format "&lt;HHHH&gt;".
279
     * @param n the number
280
     * @return the hex string
281
     */    
282
    static String toHex(int n) {
283 2 1. toHex : changed conditional boundary → NO_COVERAGE
2. toHex : negated conditional → NO_COVERAGE
        if (n < 0x10000)
284 1 1. toHex : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::toHex to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return "<" + toHex4(n) + ">";
285 1 1. toHex : Replaced integer subtraction with addition → NO_COVERAGE
        n -= 0x10000;
286 2 1. toHex : Replaced integer division with multiplication → NO_COVERAGE
2. toHex : Replaced integer addition with subtraction → NO_COVERAGE
        int high = (n / 0x400) + 0xd800;
287 2 1. toHex : Replaced integer modulus with multiplication → NO_COVERAGE
2. toHex : Replaced integer addition with subtraction → NO_COVERAGE
        int low = (n % 0x400) + 0xdc00;
288 1 1. toHex : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::toHex to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return "[<" + toHex4(high) + toHex4(low) + ">]";
289
    }
290
    
291
    /** Generates the CIDFontTyte2 dictionary.
292
     * @param fontDescriptor the indirect reference to the font descriptor
293
     * @param subsetPrefix the subset prefix
294
     * @param metrics the horizontal width metrics
295
     * @return a stream
296
     */    
297
    private PdfDictionary getCIDFontType2(PdfIndirectReference fontDescriptor, String subsetPrefix, Object[] metrics) {
298
        PdfDictionary dic = new PdfDictionary(PdfName.FONT);
299
        // sivan; cff
300 1 1. getCIDFontType2 : negated conditional → NO_COVERAGE
        if (cff) {
301 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            dic.put(PdfName.SUBTYPE, PdfName.CIDFONTTYPE0);
302 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            dic.put(PdfName.BASEFONT, new PdfName(subsetPrefix+fontName+"-"+encoding));
303
        }
304
        else {
305 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            dic.put(PdfName.SUBTYPE, PdfName.CIDFONTTYPE2);
306 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            dic.put(PdfName.BASEFONT, new PdfName(subsetPrefix + fontName));
307
        }
308 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.FONTDESCRIPTOR, fontDescriptor);
309 1 1. getCIDFontType2 : negated conditional → NO_COVERAGE
        if (!cff)
310 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          dic.put(PdfName.CIDTOGIDMAP,PdfName.IDENTITY);
311
        PdfDictionary cdic = new PdfDictionary();
312 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        cdic.put(PdfName.REGISTRY, new PdfString("Adobe"));
313 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        cdic.put(PdfName.ORDERING, new PdfString("Identity"));
314 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        cdic.put(PdfName.SUPPLEMENT, new PdfNumber(0));
315 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.CIDSYSTEMINFO, cdic);
316 1 1. getCIDFontType2 : negated conditional → NO_COVERAGE
        if (!vertical) {
317 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            dic.put(PdfName.DW, new PdfNumber(1000));
318
            StringBuilder buf = new StringBuilder("[");
319
            int lastNumber = -10;
320
            boolean firstTime = true;
321
            for (Object metric1 : metrics) {
322
                int[] metric = (int[]) metric1;
323 1 1. getCIDFontType2 : negated conditional → NO_COVERAGE
                if (metric[1] == 1000)
324
                    continue;
325
                int m = metric[0];
326 2 1. getCIDFontType2 : Replaced integer addition with subtraction → NO_COVERAGE
2. getCIDFontType2 : negated conditional → NO_COVERAGE
                if (m == lastNumber + 1) {
327
                    buf.append(' ').append(metric[1]);
328
                } else {
329 1 1. getCIDFontType2 : negated conditional → NO_COVERAGE
                    if (!firstTime) {
330
                        buf.append(']');
331
                    }
332
                    firstTime = false;
333
                    buf.append(m).append('[').append(metric[1]);
334
                }
335
                lastNumber = m;
336
            }
337 2 1. getCIDFontType2 : changed conditional boundary → NO_COVERAGE
2. getCIDFontType2 : negated conditional → NO_COVERAGE
            if (buf.length() > 1) {
338
                buf.append("]]");
339 1 1. getCIDFontType2 : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                dic.put(PdfName.W, new PdfLiteral(buf.toString()));
340
            }
341
        }
342 1 1. getCIDFontType2 : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getCIDFontType2 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return dic;
343
    }
344
    
345
    /** Generates the font dictionary.
346
     * @param descendant the descendant dictionary
347
     * @param subsetPrefix the subset prefix
348
     * @param toUnicode the ToUnicode stream
349
     * @return the stream
350
     */    
351
    private PdfDictionary getFontBaseType(PdfIndirectReference descendant, String subsetPrefix, PdfIndirectReference toUnicode) {
352
        PdfDictionary dic = new PdfDictionary(PdfName.FONT);
353
354 1 1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.SUBTYPE, PdfName.TYPE0);
355
        // The PDF Reference manual advises to add -encoding to CID font names
356 1 1. getFontBaseType : negated conditional → NO_COVERAGE
        if (cff)
357 1 1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          dic.put(PdfName.BASEFONT, new PdfName(subsetPrefix+fontName+"-"+encoding));
358
          //dic.put(PdfName.BASEFONT, new PdfName(subsetPrefix+fontName));
359
        else
360 1 1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          dic.put(PdfName.BASEFONT, new PdfName(subsetPrefix + fontName));
361
          //dic.put(PdfName.BASEFONT, new PdfName(fontName));
362 1 1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.ENCODING, new PdfName(encoding));
363 1 1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.DESCENDANTFONTS, new PdfArray(descendant));
364 1 1. getFontBaseType : negated conditional → NO_COVERAGE
        if (toUnicode != null)
365 1 1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            dic.put(PdfName.TOUNICODE, toUnicode);  
366 1 1. getFontBaseType : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getFontBaseType to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return dic;
367
    }
368
369
    /** The method used to sort the metrics array.
370
     * @param o1 the first element
371
     * @param o2 the second element
372
     * @return the comparison
373
     */    
374
    public int compare(Object o1, Object o2) {
375
        int m1 = ((int[])o1)[0];
376
        int m2 = ((int[])o2)[0];
377 1 1. compare : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return Integer.compare(m1, m2);
378
    }
379
    
380
    private static final byte[] rotbits = {(byte)0x80,(byte)0x40,(byte)0x20,(byte)0x10,(byte)0x08,(byte)0x04,(byte)0x02,(byte)0x01};
381
    
382
    /** Outputs to the writer the font dictionaries and streams.
383
     * @param writer the writer for this document
384
     * @param ref the font indirect reference
385
     * @param params several parameters that depend on the font type
386
     * @throws IOException on error
387
     * @throws DocumentException error in generating the object
388
     */
389
    void writeFont(PdfWriter writer, PdfIndirectReference ref, Object[] params) throws DocumentException, IOException {
390
        HashMap longTag = (HashMap)params[0];
391 1 1. writeFont : removed call to com/lowagie/text/pdf/TrueTypeFontUnicode::addRangeUni → NO_COVERAGE
        addRangeUni(longTag, true, subset);
392
        Object[] metrics = longTag.values().toArray();
393 1 1. writeFont : removed call to java/util/Arrays::sort → NO_COVERAGE
        Arrays.sort(metrics, this);
394
        PdfIndirectReference ind_font = null;
395
        PdfObject pobj = null;
396
        PdfIndirectObject obj = null;
397
        PdfIndirectReference cidset = null;
398 2 1. writeFont : negated conditional → NO_COVERAGE
2. writeFont : negated conditional → NO_COVERAGE
        if (writer.getPDFXConformance() == PdfWriter.PDFA1A || writer.getPDFXConformance() == PdfWriter.PDFA1B) {
399
            PdfStream stream;
400 1 1. writeFont : negated conditional → NO_COVERAGE
            if (metrics.length == 0) {
401
                stream = new PdfStream(new byte[]{(byte)0x80});
402
            }
403
            else {
404 1 1. writeFont : Replaced integer subtraction with addition → NO_COVERAGE
                int top = ((int[])metrics[metrics.length - 1])[0];
405 2 1. writeFont : Replaced integer division with multiplication → NO_COVERAGE
2. writeFont : Replaced integer addition with subtraction → NO_COVERAGE
                byte[] bt = new byte[top / 8 + 1];
406
                for (Object metric : metrics) {
407
                    int v = ((int[]) metric)[0];
408 3 1. writeFont : Replaced integer division with multiplication → NO_COVERAGE
2. writeFont : Replaced integer modulus with multiplication → NO_COVERAGE
3. writeFont : Replaced bitwise OR with AND → NO_COVERAGE
                    bt[v / 8] |= rotbits[v % 8];
409
                }
410
                stream = new PdfStream(bt);
411 1 1. writeFont : removed call to com/lowagie/text/pdf/PdfStream::flateCompress → NO_COVERAGE
                stream.flateCompress(compressionLevel);
412
            }
413
            cidset = writer.addToBody(stream).getIndirectReference();
414
        }
415
        // sivan: cff
416 1 1. writeFont : negated conditional → NO_COVERAGE
        if (cff) {
417
            byte[] b = readCffFont();
418 2 1. writeFont : negated conditional → NO_COVERAGE
2. writeFont : negated conditional → NO_COVERAGE
            if (subset || subsetRanges != null) {
419
                CFFFontSubset cff = new CFFFontSubset(new RandomAccessFileOrArray(b),longTag);
420
                b = cff.Process(cff.getNames()[0]);
421
            }
422
            pobj = new StreamFont(b, "CIDFontType0C", compressionLevel);
423
            obj = writer.addToBody(pobj);
424
            ind_font = obj.getIndirectReference();
425
        } else {
426
            byte[] b;
427 2 1. writeFont : negated conditional → NO_COVERAGE
2. writeFont : negated conditional → NO_COVERAGE
            if (subset || directoryOffset != 0) {
428
                TrueTypeFontSubSet sb = new TrueTypeFontSubSet(fileName, new RandomAccessFileOrArray(rf), longTag, directoryOffset, false, false);
429
                b = sb.process();
430
            }
431
            else {
432
                b = getFullFont();
433
            }
434
            int[] lengths = new int[]{b.length};
435
            pobj = new StreamFont(b, lengths, compressionLevel);
436
            obj = writer.addToBody(pobj);
437
            ind_font = obj.getIndirectReference();
438
        }
439
        String subsetPrefix = "";
440 1 1. writeFont : negated conditional → NO_COVERAGE
        if (subset)
441
            subsetPrefix = createSubsetPrefix();
442
        PdfDictionary dic = getFontDescriptor(ind_font, subsetPrefix, cidset);
443
        obj = writer.addToBody(dic);
444
        ind_font = obj.getIndirectReference();
445
446
        pobj = getCIDFontType2(ind_font, subsetPrefix, metrics);
447
        obj = writer.addToBody(pobj);
448
        ind_font = obj.getIndirectReference();
449
450
        pobj = getToUnicode(metrics);
451
        PdfIndirectReference toUnicodeRef = null;
452
        
453 1 1. writeFont : negated conditional → NO_COVERAGE
        if (pobj != null) {
454
            obj = writer.addToBody(pobj);
455
            toUnicodeRef = obj.getIndirectReference();
456
        }
457
458
        pobj = getFontBaseType(ind_font, subsetPrefix, toUnicodeRef);
459
        writer.addToBody(pobj, ref);
460
    }
461
    
462
    /**
463
     * Returns a PdfStream object with the full font program.
464
     * @return    a PdfStream with the font program
465
     * @since    2.1.3
466
     */
467
    public PdfStream getFullFontStream() throws IOException, DocumentException {
468 1 1. getFullFontStream : negated conditional → NO_COVERAGE
        if (cff) {
469 1 1. getFullFontStream : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getFullFontStream to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return new StreamFont(readCffFont(), "CIDFontType0C", compressionLevel);
470
        }
471 1 1. getFullFontStream : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getFullFontStream to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return super.getFullFontStream();
472
    }
473
    
474
    /** A forbidden operation. Will throw a null pointer exception.
475
     * @param text the text
476
     * @return always <CODE>null</CODE>
477
     */    
478
    byte[] convertToBytes(String text) {
479
        return null;
480
    }
481
482
    byte[] convertToBytes(int char1) {
483
        return null;
484
    }
485
486
    /** Gets the glyph index and metrics for a character.
487
     * @param c the character
488
     * @return an <CODE>int</CODE> array with {glyph index, width}
489
     */    
490
    public int[] getMetricsTT(int c) {
491 1 1. getMetricsTT : negated conditional → NO_COVERAGE
        if (cmapExt != null)
492 1 1. getMetricsTT : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return (int[])cmapExt.get(c);
493
        HashMap map = null;
494 1 1. getMetricsTT : negated conditional → NO_COVERAGE
        if (fontSpecific)
495
            map = cmap10;
496
        else
497
            map = cmap31;
498 1 1. getMetricsTT : negated conditional → NO_COVERAGE
        if (map == null)
499 1 1. getMetricsTT : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return null;
500 1 1. getMetricsTT : negated conditional → NO_COVERAGE
        if (fontSpecific) {
501 4 1. getMetricsTT : Replaced bitwise AND with OR → NO_COVERAGE
2. getMetricsTT : Replaced bitwise AND with OR → NO_COVERAGE
3. getMetricsTT : negated conditional → NO_COVERAGE
4. getMetricsTT : negated conditional → NO_COVERAGE
            if ((c & 0xffffff00) == 0 || (c & 0xffffff00) == 0xf000)
502 2 1. getMetricsTT : Replaced bitwise AND with OR → NO_COVERAGE
2. getMetricsTT : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                return (int[])map.get(c & 0xff);
503
            else
504 1 1. getMetricsTT : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                return null;
505
        }
506
        else
507 1 1. getMetricsTT : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return (int[])map.get(c);
508
    }
509
    
510
    /**
511
     * Checks if a character exists in this font.
512
     * @param c the character to check
513
     * @return <CODE>true</CODE> if the character has a glyph,
514
     * <CODE>false</CODE> otherwise
515
     */
516
    public boolean charExists(int c) {
517 2 1. charExists : negated conditional → NO_COVERAGE
2. charExists : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return getMetricsTT(c) != null;
518
    }
519
    
520
    /**
521
     * Sets the character advance.
522
     * @param c the character
523
     * @param advance the character advance normalized to 1000 units
524
     * @return <CODE>true</CODE> if the advance was set,
525
     * <CODE>false</CODE> otherwise
526
     */
527
    public boolean setCharAdvance(int c, int advance) {
528
        int[] m = getMetricsTT(c);
529 1 1. setCharAdvance : negated conditional → NO_COVERAGE
        if (m == null)
530 1 1. setCharAdvance : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return false;
531
        m[1] = advance;
532 1 1. setCharAdvance : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return true;
533
    }
534
    
535
    public int[] getCharBBox(int c) {
536 1 1. getCharBBox : negated conditional → NO_COVERAGE
        if (bboxes == null)
537 1 1. getCharBBox : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getCharBBox to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return null;
538
        int[] m = getMetricsTT(c);
539 1 1. getCharBBox : negated conditional → NO_COVERAGE
        if (m == null)
540 1 1. getCharBBox : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getCharBBox to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return null;
541 1 1. getCharBBox : mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getCharBBox to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return bboxes[m[0]];
542
    }
543
}

Mutations

93

1.1
Location :
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location :
Killed by : none
negated conditional → NO_COVERAGE

100

1.1
Location :
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location :
Killed by : none
negated conditional → NO_COVERAGE

101

1.1
Location :
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

103

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location :
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location :
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location :
Killed by : none
negated conditional → NO_COVERAGE

5.5
Location :
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location :
Killed by : none
negated conditional → NO_COVERAGE

104

1.1
Location :
Killed by : none
removed call to com/lowagie/text/pdf/TrueTypeFontUnicode::process → NO_COVERAGE

105

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

108

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location :
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location :
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location :
Killed by : none
negated conditional → NO_COVERAGE

111

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

115

1.1
Location :
Killed by : none
removed call to com/lowagie/text/pdf/TrueTypeFontUnicode::createEncoding → NO_COVERAGE

126

1.1
Location : readCMaps
Killed by : none
removed call to com/lowagie/text/pdf/TrueTypeFont::readCMaps → NO_COVERAGE

129

1.1
Location : readCMaps
Killed by : none
negated conditional → NO_COVERAGE

131

1.1
Location : readCMaps
Killed by : none
negated conditional → NO_COVERAGE

135

1.1
Location : readCMaps
Killed by : none
negated conditional → NO_COVERAGE

147

1.1
Location : getCharacterCode
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : getCharacterCode
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getCharacterCode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

157

1.1
Location : getWidth
Killed by : none
negated conditional → NO_COVERAGE

158

1.1
Location : getWidth
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

159

1.1
Location : getWidth
Killed by : none
negated conditional → NO_COVERAGE

160

1.1
Location : getWidth
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getWidth
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

3.3
Location : getWidth
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : getWidth
Killed by : none
negated conditional → NO_COVERAGE

161

1.1
Location : getWidth
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getWidth
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

163

1.1
Location : getWidth
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

166

1.1
Location : getWidth
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

176

1.1
Location : getWidth
Killed by : none
negated conditional → NO_COVERAGE

177

1.1
Location : getWidth
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

2.2
Location : getWidth
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

179

1.1
Location : getWidth
Killed by : none
negated conditional → NO_COVERAGE

183

1.1
Location : getWidth
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getWidth
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

3.3
Location : getWidth
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : getWidth
Killed by : none
negated conditional → NO_COVERAGE

184

1.1
Location : getWidth
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getWidth
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

189

1.1
Location : getWidth
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : getWidth
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : getWidth
Killed by : none
negated conditional → NO_COVERAGE

190

1.1
Location : getWidth
Killed by : none
negated conditional → NO_COVERAGE

191

1.1
Location : getWidth
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

192

1.1
Location : getWidth
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

195

1.1
Location : getWidth
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

198

1.1
Location : getWidth
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

208

1.1
Location : getToUnicode
Killed by : none
negated conditional → NO_COVERAGE

209

1.1
Location : getToUnicode
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getToUnicode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

225

1.1
Location : getToUnicode
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : getToUnicode
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : getToUnicode
Killed by : none
negated conditional → NO_COVERAGE

226

1.1
Location : getToUnicode
Killed by : none
negated conditional → NO_COVERAGE

227

1.1
Location : getToUnicode
Killed by : none
negated conditional → NO_COVERAGE

230

1.1
Location : getToUnicode
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

233

1.1
Location : getToUnicode
Killed by : none
Changed increment from -1 to 1 → NO_COVERAGE

245

1.1
Location : getToUnicode
Killed by : none
removed call to com/lowagie/text/pdf/PdfStream::flateCompress → NO_COVERAGE

246

1.1
Location : getToUnicode
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getToUnicode to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

250

1.1
Location : filterCmapMetrics
Killed by : none
negated conditional → NO_COVERAGE

251

1.1
Location : filterCmapMetrics
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::filterCmapMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

261

1.1
Location : filterCmapMetrics
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : filterCmapMetrics
Killed by : none
negated conditional → NO_COVERAGE

266

1.1
Location : filterCmapMetrics
Killed by : none
negated conditional → NO_COVERAGE

267

1.1
Location : filterCmapMetrics
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::filterCmapMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

270

1.1
Location : filterCmapMetrics
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::filterCmapMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

275

1.1
Location : toHex4
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : toHex4
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::toHex4 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

283

1.1
Location : toHex
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : toHex
Killed by : none
negated conditional → NO_COVERAGE

284

1.1
Location : toHex
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::toHex to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

285

1.1
Location : toHex
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

286

1.1
Location : toHex
Killed by : none
Replaced integer division with multiplication → NO_COVERAGE

2.2
Location : toHex
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

287

1.1
Location : toHex
Killed by : none
Replaced integer modulus with multiplication → NO_COVERAGE

2.2
Location : toHex
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

288

1.1
Location : toHex
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::toHex to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

300

1.1
Location : getCIDFontType2
Killed by : none
negated conditional → NO_COVERAGE

301

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

302

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

305

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

306

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

308

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

309

1.1
Location : getCIDFontType2
Killed by : none
negated conditional → NO_COVERAGE

310

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

312

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

313

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

314

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

315

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

316

1.1
Location : getCIDFontType2
Killed by : none
negated conditional → NO_COVERAGE

317

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

323

1.1
Location : getCIDFontType2
Killed by : none
negated conditional → NO_COVERAGE

326

1.1
Location : getCIDFontType2
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

2.2
Location : getCIDFontType2
Killed by : none
negated conditional → NO_COVERAGE

329

1.1
Location : getCIDFontType2
Killed by : none
negated conditional → NO_COVERAGE

337

1.1
Location : getCIDFontType2
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : getCIDFontType2
Killed by : none
negated conditional → NO_COVERAGE

339

1.1
Location : getCIDFontType2
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

342

1.1
Location : getCIDFontType2
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getCIDFontType2 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

354

1.1
Location : getFontBaseType
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

356

1.1
Location : getFontBaseType
Killed by : none
negated conditional → NO_COVERAGE

357

1.1
Location : getFontBaseType
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

360

1.1
Location : getFontBaseType
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

362

1.1
Location : getFontBaseType
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

363

1.1
Location : getFontBaseType
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

364

1.1
Location : getFontBaseType
Killed by : none
negated conditional → NO_COVERAGE

365

1.1
Location : getFontBaseType
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

366

1.1
Location : getFontBaseType
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getFontBaseType to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

377

1.1
Location : compare
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

391

1.1
Location : writeFont
Killed by : none
removed call to com/lowagie/text/pdf/TrueTypeFontUnicode::addRangeUni → NO_COVERAGE

393

1.1
Location : writeFont
Killed by : none
removed call to java/util/Arrays::sort → NO_COVERAGE

398

1.1
Location : writeFont
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : writeFont
Killed by : none
negated conditional → NO_COVERAGE

400

1.1
Location : writeFont
Killed by : none
negated conditional → NO_COVERAGE

404

1.1
Location : writeFont
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

405

1.1
Location : writeFont
Killed by : none
Replaced integer division with multiplication → NO_COVERAGE

2.2
Location : writeFont
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

408

1.1
Location : writeFont
Killed by : none
Replaced integer division with multiplication → NO_COVERAGE

2.2
Location : writeFont
Killed by : none
Replaced integer modulus with multiplication → NO_COVERAGE

3.3
Location : writeFont
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

411

1.1
Location : writeFont
Killed by : none
removed call to com/lowagie/text/pdf/PdfStream::flateCompress → NO_COVERAGE

416

1.1
Location : writeFont
Killed by : none
negated conditional → NO_COVERAGE

418

1.1
Location : writeFont
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : writeFont
Killed by : none
negated conditional → NO_COVERAGE

427

1.1
Location : writeFont
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : writeFont
Killed by : none
negated conditional → NO_COVERAGE

440

1.1
Location : writeFont
Killed by : none
negated conditional → NO_COVERAGE

453

1.1
Location : writeFont
Killed by : none
negated conditional → NO_COVERAGE

468

1.1
Location : getFullFontStream
Killed by : none
negated conditional → NO_COVERAGE

469

1.1
Location : getFullFontStream
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getFullFontStream to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

471

1.1
Location : getFullFontStream
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getFullFontStream to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

491

1.1
Location : getMetricsTT
Killed by : none
negated conditional → NO_COVERAGE

492

1.1
Location : getMetricsTT
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

494

1.1
Location : getMetricsTT
Killed by : none
negated conditional → NO_COVERAGE

498

1.1
Location : getMetricsTT
Killed by : none
negated conditional → NO_COVERAGE

499

1.1
Location : getMetricsTT
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

500

1.1
Location : getMetricsTT
Killed by : none
negated conditional → NO_COVERAGE

501

1.1
Location : getMetricsTT
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getMetricsTT
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

3.3
Location : getMetricsTT
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : getMetricsTT
Killed by : none
negated conditional → NO_COVERAGE

502

1.1
Location : getMetricsTT
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : getMetricsTT
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

504

1.1
Location : getMetricsTT
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

507

1.1
Location : getMetricsTT
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getMetricsTT to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

517

1.1
Location : charExists
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : charExists
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

529

1.1
Location : setCharAdvance
Killed by : none
negated conditional → NO_COVERAGE

530

1.1
Location : setCharAdvance
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

532

1.1
Location : setCharAdvance
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

536

1.1
Location : getCharBBox
Killed by : none
negated conditional → NO_COVERAGE

537

1.1
Location : getCharBBox
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getCharBBox to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

539

1.1
Location : getCharBBox
Killed by : none
negated conditional → NO_COVERAGE

540

1.1
Location : getCharBBox
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getCharBBox to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

541

1.1
Location : getCharBBox
Killed by : none
mutated return of Object value for com/lowagie/text/pdf/TrueTypeFontUnicode::getCharBBox to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.4.2