CJKFont.java

1
/*
2
 * $Id: CJKFont.java 4065 2009-09-16 23:09:11Z psoares33 $
3
 *
4
 * Copyright 2000, 2001, 2002 by 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 com.lowagie.text.DocumentException;
53
import com.lowagie.text.error_messages.MessageLocalization;
54
55
import java.io.IOException;
56
import java.io.InputStream;
57
import java.util.Enumeration;
58
import java.util.HashMap;
59
import java.util.Hashtable;
60
import java.util.Properties;
61
import java.util.StringTokenizer;
62
import java.util.concurrent.ConcurrentHashMap;
63
64
/**
65
 * Creates a CJK font compatible with the fonts in the Adobe Asian font Pack.
66
 * 
67
 * @author Paulo Soares (psoares@consiste.pt)
68
 */
69
70
class CJKFont extends BaseFont {
71
    /**
72
     * The encoding used in the PDF document for CJK fonts
73
     */
74
    static final String CJK_ENCODING = "UnicodeBigUnmarked";
75
    private static final int FIRST = 0;
76
    private static final int BRACKET = 1;
77
    private static final int SERIAL = 2;
78
    private static final int V1Y = 880;
79
80
    static Properties cjkFonts = new Properties();
81
    static Properties cjkEncodings = new Properties();
82
    Hashtable<String, char[]> allCMaps = new Hashtable<>();
83
    static ConcurrentHashMap<String, HashMap<Object, Object>> allFonts = new ConcurrentHashMap<>(
84
            500, 0.85f, 64);
85
    private static boolean propertiesLoaded = false;
86
    private static Object initLock = new Object();
87
88
    /** The font name */
89
    private String fontName;
90
    /** The style modifier */
91
    private String style = "";
92
    /** The CMap name associated with this font */
93
    private String CMap;
94
95
    private boolean cidDirect = false;
96
97
    private char[] translationMap;
98
    private IntHashtable vMetrics;
99
    private IntHashtable hMetrics;
100
    private HashMap<Object, Object> fontDesc;
101
    private boolean vertical = false;
102
103
    private static void loadProperties() {
104 1 1. loadProperties : negated conditional → NO_COVERAGE
        if (propertiesLoaded) {
105
            return;
106
        }
107
        synchronized (initLock) {
108 1 1. loadProperties : negated conditional → NO_COVERAGE
            if (propertiesLoaded) {
109
                return;
110
            }
111
            try {
112
                InputStream is = getResourceStream(RESOURCE_PATH
113
                        + "cjkfonts.properties");
114 1 1. loadProperties : removed call to java/util/Properties::load → NO_COVERAGE
                cjkFonts.load(is);
115 1 1. loadProperties : removed call to java/io/InputStream::close → NO_COVERAGE
                is.close();
116
                is = getResourceStream(RESOURCE_PATH
117
                        + "cjkencodings.properties");
118 1 1. loadProperties : removed call to java/util/Properties::load → NO_COVERAGE
                cjkEncodings.load(is);
119 1 1. loadProperties : removed call to java/io/InputStream::close → NO_COVERAGE
                is.close();
120
            } catch (Exception e) {
121
                cjkFonts = new Properties();
122
                cjkEncodings = new Properties();
123
            }
124
            propertiesLoaded = true;
125
        }
126
    }
127
128
    /**
129
     * Creates a CJK font.
130
     * 
131
     * @param fontName
132
     *            the name of the font
133
     * @param enc
134
     *            the encoding of the font
135
     * @param emb
136
     *            always <CODE>false</CODE>. CJK font and not embedded
137
     * @throws DocumentException
138
     *             on error
139
     */
140
    CJKFont(String fontName, String enc, boolean emb) throws DocumentException {
141 1 1. : removed call to com/lowagie/text/pdf/CJKFont::loadProperties → NO_COVERAGE
        loadProperties();
142
        fontType = FONT_TYPE_CJK;
143
        String nameBase = getBaseName(fontName);
144 1 1. : negated conditional → NO_COVERAGE
        if (!isCJKFont(nameBase, enc)) {
145
            throw new DocumentException(MessageLocalization.getComposedMessage(
146
                    "font.1.with.2.encoding.is.not.a.cjk.font", fontName, enc));
147
        }
148 2 1. : changed conditional boundary → NO_COVERAGE
2. : negated conditional → NO_COVERAGE
        if (nameBase.length() < fontName.length()) {
149
            style = fontName.substring(nameBase.length());
150
            fontName = nameBase;
151
        }
152
        this.fontName = fontName;
153
        encoding = CJK_ENCODING;
154
        vertical = enc.endsWith("V");
155
        CMap = enc;
156 1 1. : negated conditional → NO_COVERAGE
        if (enc.startsWith("Identity-")) {
157
            cidDirect = true;
158
            String s = cjkFonts.getProperty(fontName);
159
            s = s.substring(0, s.indexOf('_'));
160
            char[] c = allCMaps.get(s);
161 1 1. : negated conditional → NO_COVERAGE
            if (c == null) {
162
                c = readCMap(s);
163 1 1. : negated conditional → NO_COVERAGE
                if (c == null) {
164
                    throw new DocumentException(
165
                            MessageLocalization.getComposedMessage(
166
                                    "the.cmap.1.does.not.exist.as.a.resource",
167
                                    s));
168
                }
169
                c[CID_NEWLINE] = '\n';
170
                allCMaps.put(s, c);
171
            }
172
            translationMap = c;
173
        } else {
174
            char[] c = allCMaps.get(enc);
175 1 1. : negated conditional → NO_COVERAGE
            if (c == null) {
176
                String s = cjkEncodings.getProperty(enc);
177 1 1. : negated conditional → NO_COVERAGE
                if (s == null) {
178
                    throw new DocumentException(
179
                            MessageLocalization
180
                                    .getComposedMessage(
181
                                            "the.resource.cjkencodings.properties.does.not.contain.the.encoding.1",
182
                                            enc));
183
                }
184
                StringTokenizer tk = new StringTokenizer(s);
185
                String nt = tk.nextToken();
186
                c = allCMaps.get(nt);
187 1 1. : negated conditional → NO_COVERAGE
                if (c == null) {
188
                    c = readCMap(nt);
189
                    allCMaps.put(nt, c);
190
                }
191 1 1. : negated conditional → NO_COVERAGE
                if (tk.hasMoreTokens()) {
192
                    String nt2 = tk.nextToken();
193
                    char[] m2 = readCMap(nt2);
194 3 1. : changed conditional boundary → NO_COVERAGE
2. : Changed increment from 1 to -1 → NO_COVERAGE
3. : negated conditional → NO_COVERAGE
                    for (int k = 0; k < 0x10000; ++k) {
195 1 1. : negated conditional → NO_COVERAGE
                        if (m2[k] == 0) {
196
                            m2[k] = c[k];
197
                        }
198
                    }
199
                    allCMaps.put(enc, m2);
200
                    c = m2;
201
                }
202
            }
203
            translationMap = c;
204
        }
205
        fontDesc = allFonts.get(fontName);
206 1 1. : negated conditional → NO_COVERAGE
        if (fontDesc == null) {
207
            fontDesc = readFontProperties(fontName);
208
            allFonts.putIfAbsent(fontName, fontDesc);
209
            fontDesc = allFonts.get(fontName);
210
        }
211
        hMetrics = (IntHashtable) fontDesc.get("W");
212
        vMetrics = (IntHashtable) fontDesc.get("W2");
213
    }
214
215
    /**
216
     * Checks if its a valid CJK font.
217
     * 
218
     * @param fontName
219
     *            the font name
220
     * @param enc
221
     *            the encoding
222
     * @return <CODE>true</CODE> if it is CJK font
223
     */
224
    public static boolean isCJKFont(String fontName, String enc) {
225 1 1. isCJKFont : removed call to com/lowagie/text/pdf/CJKFont::loadProperties → NO_COVERAGE
        loadProperties();
226
        String encodings = cjkFonts.getProperty(fontName);
227 2 1. isCJKFont : negated conditional → NO_COVERAGE
2. isCJKFont : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return encodings != null
228 3 1. isCJKFont : negated conditional → NO_COVERAGE
2. isCJKFont : negated conditional → NO_COVERAGE
3. isCJKFont : negated conditional → NO_COVERAGE
                && (enc.equals("Identity-H") || enc.equals("Identity-V") || encodings.contains("_" + enc + "_"));
229
    }
230
231
    /**
232
     * Gets the width of a <CODE>char</CODE> in normalized 1000 units.
233
     * 
234
     * @param char1
235
     *            the unicode <CODE>char</CODE> to get the width of
236
     * @return the width in normalized 1000 units
237
     */
238
    @Override
239
    public int getWidth(int char1) {
240
        int c = char1;
241 1 1. getWidth : negated conditional → NO_COVERAGE
        if (!cidDirect) {
242
            c = translationMap[c];
243
        }
244
        int v;
245 1 1. getWidth : negated conditional → NO_COVERAGE
        if (vertical) {
246
            v = vMetrics.get(c);
247
        } else {
248
            v = hMetrics.get(c);
249
        }
250 2 1. getWidth : changed conditional boundary → NO_COVERAGE
2. getWidth : negated conditional → NO_COVERAGE
        if (v > 0) {
251 1 1. getWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return v;
252
        } else {
253 1 1. getWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return 1000;
254
        }
255
    }
256
257
    @Override
258
    public int getWidth(String text) {
259
        int total = 0;
260 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 < text.length(); ++k) {
261
            int c = text.charAt(k);
262 1 1. getWidth : negated conditional → NO_COVERAGE
            if (!cidDirect) {
263
                c = translationMap[c];
264
            }
265
            int v;
266 1 1. getWidth : negated conditional → NO_COVERAGE
            if (vertical) {
267
                v = vMetrics.get(c);
268
            } else {
269
                v = hMetrics.get(c);
270
            }
271 2 1. getWidth : changed conditional boundary → NO_COVERAGE
2. getWidth : negated conditional → NO_COVERAGE
            if (v > 0) {
272 1 1. getWidth : Replaced integer addition with subtraction → NO_COVERAGE
                total += v;
273
            } else {
274 1 1. getWidth : Changed increment from 1000 to -1000 → NO_COVERAGE
                total += 1000;
275
            }
276
        }
277 1 1. getWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return total;
278
    }
279
280
    @Override
281
    int getRawWidth(int c, String name) {
282
        return 0;
283
    }
284
285
    @Override
286
    public int getKerning(int char1, int char2) {
287
        return 0;
288
    }
289
290
    private PdfDictionary getFontDescriptor() {
291
        PdfDictionary dic = new PdfDictionary(PdfName.FONTDESCRIPTOR);
292 1 1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.ASCENT, new PdfLiteral((String) fontDesc.get("Ascent")));
293 1 1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.CAPHEIGHT,
294
                new PdfLiteral((String) fontDesc.get("CapHeight")));
295 1 1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.DESCENT,
296
                new PdfLiteral((String) fontDesc.get("Descent")));
297 1 1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.FLAGS, new PdfLiteral((String) fontDesc.get("Flags")));
298 1 1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.FONTBBOX,
299
                new PdfLiteral((String) fontDesc.get("FontBBox")));
300 1 1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.FONTNAME, new PdfName(fontName + style));
301 1 1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.ITALICANGLE,
302
                new PdfLiteral((String) fontDesc.get("ItalicAngle")));
303 1 1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.STEMV, new PdfLiteral((String) fontDesc.get("StemV")));
304
        PdfDictionary pdic = new PdfDictionary();
305 1 1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        pdic.put(PdfName.PANOSE, new PdfString((String) fontDesc.get("Panose"),
306
                null));
307 1 1. getFontDescriptor : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.STYLE, pdic);
308 1 1. getFontDescriptor : mutated return of Object value for com/lowagie/text/pdf/CJKFont::getFontDescriptor to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return dic;
309
    }
310
311
    private PdfDictionary getCIDFont(PdfIndirectReference fontDescriptor,
312
            IntHashtable cjkTag) {
313
        PdfDictionary dic = new PdfDictionary(PdfName.FONT);
314 1 1. getCIDFont : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.SUBTYPE, PdfName.CIDFONTTYPE0);
315 1 1. getCIDFont : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.BASEFONT, new PdfName(fontName + style));
316 1 1. getCIDFont : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.FONTDESCRIPTOR, fontDescriptor);
317
        int[] keys = cjkTag.toOrderedKeys();
318
        String w = convertToHCIDMetrics(keys, hMetrics);
319 1 1. getCIDFont : negated conditional → NO_COVERAGE
        if (w != null) {
320 1 1. getCIDFont : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            dic.put(PdfName.W, new PdfLiteral(w));
321
        }
322 1 1. getCIDFont : negated conditional → NO_COVERAGE
        if (vertical) {
323
            w = convertToVCIDMetrics(keys, vMetrics, hMetrics);
324 1 1. getCIDFont : negated conditional → NO_COVERAGE
            if (w != null) {
325 1 1. getCIDFont : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                dic.put(PdfName.W2, new PdfLiteral(w));
326
            }
327
        } else {
328 1 1. getCIDFont : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            dic.put(PdfName.DW, new PdfNumber(1000));
329
        }
330
        PdfDictionary cdic = new PdfDictionary();
331 1 1. getCIDFont : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        cdic.put(PdfName.REGISTRY,
332
                new PdfString((String) fontDesc.get("Registry"), null));
333 1 1. getCIDFont : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        cdic.put(PdfName.ORDERING,
334
                new PdfString((String) fontDesc.get("Ordering"), null));
335 1 1. getCIDFont : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        cdic.put(PdfName.SUPPLEMENT,
336
                new PdfLiteral((String) fontDesc.get("Supplement")));
337 1 1. getCIDFont : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.CIDSYSTEMINFO, cdic);
338 1 1. getCIDFont : mutated return of Object value for com/lowagie/text/pdf/CJKFont::getCIDFont to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return dic;
339
    }
340
341
    private PdfDictionary getFontBaseType(PdfIndirectReference CIDFont) {
342
        PdfDictionary dic = new PdfDictionary(PdfName.FONT);
343 1 1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.SUBTYPE, PdfName.TYPE0);
344
        String name = fontName;
345 2 1. getFontBaseType : changed conditional boundary → NO_COVERAGE
2. getFontBaseType : negated conditional → NO_COVERAGE
        if (style.length() > 0) {
346
            name += "-" + style.substring(1);
347
        }
348
        name += "-" + CMap;
349 1 1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.BASEFONT, new PdfName(name));
350 1 1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.ENCODING, new PdfName(CMap));
351 1 1. getFontBaseType : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        dic.put(PdfName.DESCENDANTFONTS, new PdfArray(CIDFont));
352 1 1. getFontBaseType : mutated return of Object value for com/lowagie/text/pdf/CJKFont::getFontBaseType to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return dic;
353
    }
354
355
    @Override
356
    void writeFont(PdfWriter writer, PdfIndirectReference ref, Object[] params)
357
            throws DocumentException, IOException {
358
        IntHashtable cjkTag = (IntHashtable) params[0];
359
        PdfIndirectReference ind_font = null;
360
        PdfObject pobj = null;
361
        PdfIndirectObject obj = null;
362
        pobj = getFontDescriptor();
363 1 1. writeFont : negated conditional → NO_COVERAGE
        if (pobj != null) {
364
            obj = writer.addToBody(pobj);
365
            ind_font = obj.getIndirectReference();
366
        }
367
        pobj = getCIDFont(ind_font, cjkTag);
368 1 1. writeFont : negated conditional → NO_COVERAGE
        if (pobj != null) {
369
            obj = writer.addToBody(pobj);
370
            ind_font = obj.getIndirectReference();
371
        }
372
        pobj = getFontBaseType(ind_font);
373
        writer.addToBody(pobj, ref);
374
    }
375
376
    /**
377
     * You can't get the FontStream of a CJK font (CJK fonts are never
378
     * embedded), so this method always returns null.
379
     * 
380
     * @return null
381
     * @since 2.1.3
382
     */
383
    @Override
384
    public PdfStream getFullFontStream() {
385
        return null;
386
    }
387
388
    private float getDescNumber(String name) {
389 1 1. getDescNumber : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getDescNumber → NO_COVERAGE
        return Integer.parseInt((String) fontDesc.get(name));
390
    }
391
392
    private float getBBox(int idx) {
393
        String s = (String) fontDesc.get("FontBBox");
394
        StringTokenizer tk = new StringTokenizer(s, " []\r\n\t\f");
395
        String ret = tk.nextToken();
396 3 1. getBBox : changed conditional boundary → NO_COVERAGE
2. getBBox : Changed increment from 1 to -1 → NO_COVERAGE
3. getBBox : negated conditional → NO_COVERAGE
        for (int k = 0; k < idx; ++k) {
397
            ret = tk.nextToken();
398
        }
399 1 1. getBBox : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getBBox → NO_COVERAGE
        return Integer.parseInt(ret);
400
    }
401
402
    /**
403
     * Gets the font parameter identified by <CODE>key</CODE>. Valid values for
404
     * <CODE>key</CODE> are <CODE>ASCENT</CODE>, <CODE>CAPHEIGHT</CODE>,
405
     * <CODE>DESCENT</CODE> and <CODE>ITALICANGLE</CODE>.
406
     * 
407
     * @param key
408
     *            the parameter to be extracted
409
     * @param fontSize
410
     *            the font size in points
411
     * @return the parameter in points
412
     */
413
    @Override
414
    public float getFontDescriptor(int key, float fontSize) {
415
        switch (key) {
416
        case AWT_ASCENT:
417
        case ASCENT:
418 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/CJKFont::getFontDescriptor → NO_COVERAGE
            return getDescNumber("Ascent") * fontSize / 1000;
419
        case CAPHEIGHT:
420 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/CJKFont::getFontDescriptor → NO_COVERAGE
            return getDescNumber("CapHeight") * fontSize / 1000;
421
        case AWT_DESCENT:
422
        case DESCENT:
423 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/CJKFont::getFontDescriptor → NO_COVERAGE
            return getDescNumber("Descent") * fontSize / 1000;
424
        case ITALICANGLE:
425 1 1. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE
            return getDescNumber("ItalicAngle");
426
        case BBOXLLX:
427 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/CJKFont::getFontDescriptor → NO_COVERAGE
            return fontSize * getBBox(0) / 1000;
428
        case BBOXLLY:
429 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/CJKFont::getFontDescriptor → NO_COVERAGE
            return fontSize * getBBox(1) / 1000;
430
        case BBOXURX:
431 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/CJKFont::getFontDescriptor → NO_COVERAGE
            return fontSize * getBBox(2) / 1000;
432
        case BBOXURY:
433 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/CJKFont::getFontDescriptor → NO_COVERAGE
            return fontSize * getBBox(3) / 1000;
434
        case AWT_LEADING:
435 1 1. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE
            return 0;
436
        case AWT_MAXADVANCE:
437 4 1. getFontDescriptor : Replaced float subtraction with addition → 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/CJKFont::getFontDescriptor → NO_COVERAGE
            return fontSize * (getBBox(2) - getBBox(0)) / 1000;
438
        }
439 1 1. getFontDescriptor : replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE
        return 0;
440
    }
441
442
    @Override
443
    public String getPostscriptFontName() {
444
        return fontName;
445
    }
446
447
    /**
448
     * Gets the full name of the font. If it is a True Type font each array
449
     * element will have {Platform ID, Platform Encoding ID, Language ID, font
450
     * name}. The interpretation of this values can be found in the Open Type
451
     * specification, chapter 2, in the 'name' table.<br>
452
     * For the other fonts the array has a single element with {"", "", "", font
453
     * name}.
454
     * 
455
     * @return the full name of the font
456
     */
457
    @Override
458
    public String[][] getFullFontName() {
459 1 1. getFullFontName : mutated return of Object value for com/lowagie/text/pdf/CJKFont::getFullFontName to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new String[][] { { "", "", "", fontName } };
460
    }
461
462
    /**
463
     * Gets all the entries of the names-table. If it is a True Type font each
464
     * array element will have {Name ID, Platform ID, Platform Encoding ID,
465
     * Language ID, font name}. The interpretation of this values can be found
466
     * in the Open Type specification, chapter 2, in the 'name' table.<br>
467
     * For the other fonts the array has a single element with {"4", "", "", "",
468
     * font name}.
469
     * 
470
     * @return the full name of the font
471
     */
472
    @Override
473
    public String[][] getAllNameEntries() {
474 1 1. getAllNameEntries : mutated return of Object value for com/lowagie/text/pdf/CJKFont::getAllNameEntries to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new String[][] { { "4", "", "", "", fontName } };
475
    }
476
477
    /**
478
     * Gets the family name of the font. If it is a True Type font each array
479
     * element will have {Platform ID, Platform Encoding ID, Language ID, font
480
     * name}. The interpretation of this values can be found in the Open Type
481
     * specification, chapter 2, in the 'name' table.<br>
482
     * For the other fonts the array has a single element with {"", "", "", font
483
     * name}.
484
     * 
485
     * @return the family name of the font
486
     */
487
    @Override
488
    public String[][] getFamilyFontName() {
489
        return getFullFontName();
490
    }
491
492
    static char[] readCMap(String name) {
493
        try {
494
            name = name + ".cmap";
495
            InputStream is = getResourceStream(RESOURCE_PATH + name);
496
            char[] c = new char[0x10000];
497 3 1. readCMap : changed conditional boundary → NO_COVERAGE
2. readCMap : Changed increment from 1 to -1 → NO_COVERAGE
3. readCMap : negated conditional → NO_COVERAGE
            for (int k = 0; k < 0x10000; ++k) {
498 2 1. readCMap : Replaced Shift Left with Shift Right → NO_COVERAGE
2. readCMap : Replaced integer addition with subtraction → NO_COVERAGE
                c[k] = (char) ((is.read() << 8) + is.read());
499
            }
500 1 1. readCMap : removed call to java/io/InputStream::close → NO_COVERAGE
            is.close();
501 1 1. readCMap : mutated return of Object value for com/lowagie/text/pdf/CJKFont::readCMap to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return c;
502
        } catch (Exception e) {
503
            // empty on purpose
504
        }
505 1 1. readCMap : mutated return of Object value for com/lowagie/text/pdf/CJKFont::readCMap to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return null;
506
    }
507
508
    static IntHashtable createMetric(String s) {
509
        IntHashtable h = new IntHashtable();
510
        StringTokenizer tk = new StringTokenizer(s);
511 1 1. createMetric : negated conditional → NO_COVERAGE
        while (tk.hasMoreTokens()) {
512
            int n1 = Integer.parseInt(tk.nextToken());
513
            h.put(n1, Integer.parseInt(tk.nextToken()));
514
        }
515 1 1. createMetric : mutated return of Object value for com/lowagie/text/pdf/CJKFont::createMetric to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return h;
516
    }
517
518
    static String convertToHCIDMetrics(int[] keys, IntHashtable h) {
519 1 1. convertToHCIDMetrics : negated conditional → NO_COVERAGE
        if (keys.length == 0) {
520 1 1. convertToHCIDMetrics : mutated return of Object value for com/lowagie/text/pdf/CJKFont::convertToHCIDMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return null;
521
        }
522
        int lastCid = 0;
523
        int lastValue = 0;
524
        int start;
525 3 1. convertToHCIDMetrics : changed conditional boundary → NO_COVERAGE
2. convertToHCIDMetrics : Changed increment from 1 to -1 → NO_COVERAGE
3. convertToHCIDMetrics : negated conditional → NO_COVERAGE
        for (start = 0; start < keys.length; ++start) {
526
            lastCid = keys[start];
527
            lastValue = h.get(lastCid);
528 1 1. convertToHCIDMetrics : negated conditional → NO_COVERAGE
            if (lastValue != 0) {
529 1 1. convertToHCIDMetrics : Changed increment from 1 to -1 → NO_COVERAGE
                ++start;
530
                break;
531
            }
532
        }
533 1 1. convertToHCIDMetrics : negated conditional → NO_COVERAGE
        if (lastValue == 0) {
534 1 1. convertToHCIDMetrics : mutated return of Object value for com/lowagie/text/pdf/CJKFont::convertToHCIDMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return null;
535
        }
536
        StringBuilder buf = new StringBuilder();
537
        buf.append('[');
538
        buf.append(lastCid);
539
        int state = FIRST;
540 3 1. convertToHCIDMetrics : changed conditional boundary → NO_COVERAGE
2. convertToHCIDMetrics : Changed increment from 1 to -1 → NO_COVERAGE
3. convertToHCIDMetrics : negated conditional → NO_COVERAGE
        for (int k = start; k < keys.length; ++k) {
541
            int cid = keys[k];
542
            int value = h.get(cid);
543 1 1. convertToHCIDMetrics : negated conditional → NO_COVERAGE
            if (value == 0) {
544
                continue;
545
            }
546
            switch (state) {
547
            case FIRST: {
548 3 1. convertToHCIDMetrics : Replaced integer addition with subtraction → NO_COVERAGE
2. convertToHCIDMetrics : negated conditional → NO_COVERAGE
3. convertToHCIDMetrics : negated conditional → NO_COVERAGE
                if (cid == lastCid + 1 && value == lastValue) {
549
                    state = SERIAL;
550 2 1. convertToHCIDMetrics : Replaced integer addition with subtraction → NO_COVERAGE
2. convertToHCIDMetrics : negated conditional → NO_COVERAGE
                } else if (cid == lastCid + 1) {
551
                    state = BRACKET;
552
                    buf.append('[').append(lastValue);
553
                } else {
554
                    buf.append('[').append(lastValue).append(']').append(cid);
555
                }
556
                break;
557
            }
558
            case BRACKET: {
559 3 1. convertToHCIDMetrics : Replaced integer addition with subtraction → NO_COVERAGE
2. convertToHCIDMetrics : negated conditional → NO_COVERAGE
3. convertToHCIDMetrics : negated conditional → NO_COVERAGE
                if (cid == lastCid + 1 && value == lastValue) {
560
                    state = SERIAL;
561
                    buf.append(']').append(lastCid);
562 2 1. convertToHCIDMetrics : Replaced integer addition with subtraction → NO_COVERAGE
2. convertToHCIDMetrics : negated conditional → NO_COVERAGE
                } else if (cid == lastCid + 1) {
563
                    buf.append(' ').append(lastValue);
564
                } else {
565
                    state = FIRST;
566
                    buf.append(' ').append(lastValue).append(']').append(cid);
567
                }
568
                break;
569
            }
570
            case SERIAL: {
571 3 1. convertToHCIDMetrics : Replaced integer addition with subtraction → NO_COVERAGE
2. convertToHCIDMetrics : negated conditional → NO_COVERAGE
3. convertToHCIDMetrics : negated conditional → NO_COVERAGE
                if (cid != lastCid + 1 || value != lastValue) {
572
                    buf.append(' ').append(lastCid).append(' ')
573
                            .append(lastValue).append(' ').append(cid);
574
                    state = FIRST;
575
                }
576
                break;
577
            }
578
            }
579
            lastValue = value;
580
            lastCid = cid;
581
        }
582
        switch (state) {
583
        case FIRST: {
584
            buf.append('[').append(lastValue).append("]]");
585
            break;
586
        }
587
        case BRACKET: {
588
            buf.append(' ').append(lastValue).append("]]");
589
            break;
590
        }
591
        case SERIAL: {
592
            buf.append(' ').append(lastCid).append(' ').append(lastValue)
593
                    .append(']');
594
            break;
595
        }
596
        }
597 1 1. convertToHCIDMetrics : mutated return of Object value for com/lowagie/text/pdf/CJKFont::convertToHCIDMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return buf.toString();
598
    }
599
600
    static String convertToVCIDMetrics(int[] keys, IntHashtable v,
601
                                       IntHashtable h) {
602 1 1. convertToVCIDMetrics : negated conditional → NO_COVERAGE
        if (keys.length == 0) {
603 1 1. convertToVCIDMetrics : mutated return of Object value for com/lowagie/text/pdf/CJKFont::convertToVCIDMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return null;
604
        }
605
        int lastCid = 0;
606
        int lastValue = 0;
607
        int lastHValue = 0;
608
        int start;
609 3 1. convertToVCIDMetrics : changed conditional boundary → NO_COVERAGE
2. convertToVCIDMetrics : Changed increment from 1 to -1 → NO_COVERAGE
3. convertToVCIDMetrics : negated conditional → NO_COVERAGE
        for (start = 0; start < keys.length; ++start) {
610
            lastCid = keys[start];
611
            lastValue = v.get(lastCid);
612 1 1. convertToVCIDMetrics : negated conditional → NO_COVERAGE
            if (lastValue != 0) {
613 1 1. convertToVCIDMetrics : Changed increment from 1 to -1 → NO_COVERAGE
                ++start;
614
                break;
615
            } else {
616
                lastHValue = h.get(lastCid);
617
            }
618
        }
619 1 1. convertToVCIDMetrics : negated conditional → NO_COVERAGE
        if (lastValue == 0) {
620 1 1. convertToVCIDMetrics : mutated return of Object value for com/lowagie/text/pdf/CJKFont::convertToVCIDMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return null;
621
        }
622 1 1. convertToVCIDMetrics : negated conditional → NO_COVERAGE
        if (lastHValue == 0) {
623
            lastHValue = 1000;
624
        }
625
        StringBuilder buf = new StringBuilder();
626
        buf.append('[');
627
        buf.append(lastCid);
628
        int state = FIRST;
629 3 1. convertToVCIDMetrics : changed conditional boundary → NO_COVERAGE
2. convertToVCIDMetrics : Changed increment from 1 to -1 → NO_COVERAGE
3. convertToVCIDMetrics : negated conditional → NO_COVERAGE
        for (int k = start; k < keys.length; ++k) {
630
            int cid = keys[k];
631
            int value = v.get(cid);
632 1 1. convertToVCIDMetrics : negated conditional → NO_COVERAGE
            if (value == 0) {
633
                continue;
634
            }
635
            int hValue = h.get(lastCid);
636 1 1. convertToVCIDMetrics : negated conditional → NO_COVERAGE
            if (hValue == 0) {
637
                hValue = 1000;
638
            }
639
            switch (state) {
640
            case FIRST: {
641 4 1. convertToVCIDMetrics : Replaced integer addition with subtraction → NO_COVERAGE
2. convertToVCIDMetrics : negated conditional → NO_COVERAGE
3. convertToVCIDMetrics : negated conditional → NO_COVERAGE
4. convertToVCIDMetrics : negated conditional → NO_COVERAGE
                if (cid == lastCid + 1 && value == lastValue
642
                        && hValue == lastHValue) {
643
                    state = SERIAL;
644
                } else {
645 1 1. convertToVCIDMetrics : removed negation → NO_COVERAGE
                    buf.append(' ').append(lastCid).append(' ')
646 1 1. convertToVCIDMetrics : Replaced integer division with multiplication → NO_COVERAGE
                            .append(-lastValue).append(' ')
647
                            .append(lastHValue / 2).append(' ').append(V1Y)
648
                            .append(' ').append(cid);
649
                }
650
                break;
651
            }
652
            case SERIAL: {
653 4 1. convertToVCIDMetrics : Replaced integer addition with subtraction → NO_COVERAGE
2. convertToVCIDMetrics : negated conditional → NO_COVERAGE
3. convertToVCIDMetrics : negated conditional → NO_COVERAGE
4. convertToVCIDMetrics : negated conditional → NO_COVERAGE
                if (cid != lastCid + 1 || value != lastValue
654
                        || hValue != lastHValue) {
655 1 1. convertToVCIDMetrics : removed negation → NO_COVERAGE
                    buf.append(' ').append(lastCid).append(' ')
656 1 1. convertToVCIDMetrics : Replaced integer division with multiplication → NO_COVERAGE
                            .append(-lastValue).append(' ')
657
                            .append(lastHValue / 2).append(' ').append(V1Y)
658
                            .append(' ').append(cid);
659
                    state = FIRST;
660
                }
661
                break;
662
            }
663
            }
664
            lastValue = value;
665
            lastCid = cid;
666
            lastHValue = hValue;
667
        }
668 1 1. convertToVCIDMetrics : removed negation → NO_COVERAGE
        buf.append(' ').append(lastCid).append(' ').append(-lastValue)
669 1 1. convertToVCIDMetrics : Replaced integer division with multiplication → NO_COVERAGE
                .append(' ').append(lastHValue / 2).append(' ').append(V1Y)
670
                .append(" ]");
671 1 1. convertToVCIDMetrics : mutated return of Object value for com/lowagie/text/pdf/CJKFont::convertToVCIDMetrics to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return buf.toString();
672
    }
673
674
    static HashMap<Object, Object> readFontProperties(String name) {
675
        try {
676
            name += ".properties";
677
            InputStream is = getResourceStream(RESOURCE_PATH + name);
678
            Properties p = new Properties();
679 1 1. readFontProperties : removed call to java/util/Properties::load → NO_COVERAGE
            p.load(is);
680 1 1. readFontProperties : removed call to java/io/InputStream::close → NO_COVERAGE
            is.close();
681
            IntHashtable W = createMetric(p.getProperty("W"));
682
            p.remove("W");
683
            IntHashtable W2 = createMetric(p.getProperty("W2"));
684
            p.remove("W2");
685
            HashMap<Object, Object> map = new HashMap<>();
686 1 1. readFontProperties : negated conditional → NO_COVERAGE
            for (Enumeration e = p.keys(); e.hasMoreElements();) {
687
                Object obj = e.nextElement();
688
                map.put(obj, p.getProperty((String) obj));
689
            }
690
            map.put("W", W);
691
            map.put("W2", W2);
692 1 1. readFontProperties : mutated return of Object value for com/lowagie/text/pdf/CJKFont::readFontProperties to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return map;
693
        } catch (Exception e) {
694
            // empty on purpose
695
        }
696 1 1. readFontProperties : mutated return of Object value for com/lowagie/text/pdf/CJKFont::readFontProperties to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return null;
697
    }
698
699
    @Override
700
    public int getUnicodeEquivalent(int c) {
701 1 1. getUnicodeEquivalent : negated conditional → NO_COVERAGE
        if (cidDirect) {
702 1 1. getUnicodeEquivalent : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return translationMap[c];
703
        }
704 1 1. getUnicodeEquivalent : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return c;
705
    }
706
707
    @Override
708
    public int getCidCode(int c) {
709 1 1. getCidCode : negated conditional → NO_COVERAGE
        if (cidDirect) {
710 1 1. getCidCode : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return c;
711
        }
712 1 1. getCidCode : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return translationMap[c];
713
    }
714
715
    /**
716
     * Checks if the font has any kerning pairs.
717
     * 
718
     * @return always <CODE>false</CODE>
719
     */
720
    @Override
721
    public boolean hasKernPairs() {
722
        return false;
723
    }
724
725
    /**
726
     * Checks if a character exists in this font.
727
     * 
728
     * @param c
729
     *            the character to check
730
     * @return <CODE>true</CODE> if the character has a glyph,
731
     *         <CODE>false</CODE> otherwise
732
     */
733
    @Override
734
    public boolean charExists(int c) {
735 2 1. charExists : negated conditional → NO_COVERAGE
2. charExists : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return translationMap[c] != 0;
736
    }
737
738
    /**
739
     * Sets the character advance.
740
     * 
741
     * @param c
742
     *            the character
743
     * @param advance
744
     *            the character advance normalized to 1000 units
745
     * @return <CODE>true</CODE> if the advance was set, <CODE>false</CODE>
746
     *         otherwise. Will always return <CODE>false</CODE>
747
     */
748
    @Override
749
    public boolean setCharAdvance(int c, int advance) {
750
        return false;
751
    }
752
753
    /**
754
     * Sets the font name that will appear in the pdf font dictionary. Use with
755
     * care as it can easily make a font unreadable if not embedded.
756
     * 
757
     * @param name
758
     *            the new font name
759
     */
760
    @Override
761
    public void setPostscriptFontName(String name) {
762
        fontName = name;
763
    }
764
765
    @Override
766
    public boolean setKerning(int char1, int char2, int kern) {
767
        return false;
768
    }
769
770
    @Override
771
    public int[] getCharBBox(int c) {
772
        return null;
773
    }
774
775
    @Override
776
    protected int[] getRawCharBBox(int c, String name) {
777
        return null;
778
    }
779
}

Mutations

104

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

108

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

114

1.1
Location : loadProperties
Killed by : none
removed call to java/util/Properties::load → NO_COVERAGE

115

1.1
Location : loadProperties
Killed by : none
removed call to java/io/InputStream::close → NO_COVERAGE

118

1.1
Location : loadProperties
Killed by : none
removed call to java/util/Properties::load → NO_COVERAGE

119

1.1
Location : loadProperties
Killed by : none
removed call to java/io/InputStream::close → NO_COVERAGE

141

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

144

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

148

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

2.2
Location :
Killed by : none
negated conditional → NO_COVERAGE

156

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

161

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

163

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

175

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

177

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

187

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

191

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

194

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

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

3.3
Location :
Killed by : none
negated conditional → NO_COVERAGE

195

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

206

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

225

1.1
Location : isCJKFont
Killed by : none
removed call to com/lowagie/text/pdf/CJKFont::loadProperties → NO_COVERAGE

227

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

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

228

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

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

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

241

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

245

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

250

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

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

251

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

253

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

260

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

262

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

266

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

271

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

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

272

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

274

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

277

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

292

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

293

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

295

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

297

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

298

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

300

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

301

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

303

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

305

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

307

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

308

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

314

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

315

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

316

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

319

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

320

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

322

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

324

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

325

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

328

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

331

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

333

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

335

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

337

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

338

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

343

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

345

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

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

349

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

350

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

351

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

352

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

363

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

368

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

389

1.1
Location : getDescNumber
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getDescNumber → NO_COVERAGE

396

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

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

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

399

1.1
Location : getBBox
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getBBox → NO_COVERAGE

418

1.1
Location : getFontDescriptor
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : getFontDescriptor
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

3.3
Location : getFontDescriptor
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE

420

1.1
Location : getFontDescriptor
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : getFontDescriptor
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

3.3
Location : getFontDescriptor
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE

423

1.1
Location : getFontDescriptor
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : getFontDescriptor
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

3.3
Location : getFontDescriptor
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE

425

1.1
Location : getFontDescriptor
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE

427

1.1
Location : getFontDescriptor
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : getFontDescriptor
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

3.3
Location : getFontDescriptor
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE

429

1.1
Location : getFontDescriptor
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : getFontDescriptor
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

3.3
Location : getFontDescriptor
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE

431

1.1
Location : getFontDescriptor
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : getFontDescriptor
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

3.3
Location : getFontDescriptor
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE

433

1.1
Location : getFontDescriptor
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : getFontDescriptor
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

3.3
Location : getFontDescriptor
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE

435

1.1
Location : getFontDescriptor
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE

437

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

2.2
Location : getFontDescriptor
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

3.3
Location : getFontDescriptor
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

4.4
Location : getFontDescriptor
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE

439

1.1
Location : getFontDescriptor
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/pdf/CJKFont::getFontDescriptor → NO_COVERAGE

459

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

474

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

497

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

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

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

498

1.1
Location : readCMap
Killed by : none
Replaced Shift Left with Shift Right → NO_COVERAGE

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

500

1.1
Location : readCMap
Killed by : none
removed call to java/io/InputStream::close → NO_COVERAGE

501

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

505

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

511

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

515

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

519

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

520

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

525

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

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

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

528

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

529

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

533

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

534

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

540

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

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

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

543

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

548

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

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

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

550

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

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

559

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

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

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

562

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

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

571

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

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

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

597

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

602

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

603

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

609

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

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

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

612

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

613

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

619

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

620

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

622

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

629

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

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

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

632

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

636

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

641

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

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

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

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

645

1.1
Location : convertToVCIDMetrics
Killed by : none
removed negation → NO_COVERAGE

646

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

653

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

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

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

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

655

1.1
Location : convertToVCIDMetrics
Killed by : none
removed negation → NO_COVERAGE

656

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

668

1.1
Location : convertToVCIDMetrics
Killed by : none
removed negation → NO_COVERAGE

669

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

671

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

679

1.1
Location : readFontProperties
Killed by : none
removed call to java/util/Properties::load → NO_COVERAGE

680

1.1
Location : readFontProperties
Killed by : none
removed call to java/io/InputStream::close → NO_COVERAGE

686

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

692

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

696

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

701

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

702

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

704

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

709

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

710

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

712

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

735

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

Active mutators

Tests examined


Report generated by PIT 1.4.2