You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "hailima (Jira)" <ji...@apache.org> on 2019/09/05 20:14:00 UTC

[jira] [Created] (PDFBOX-4643) No glyph for U+2032 in font TimesNewRomanPSMT

hailima created PDFBOX-4643:
-------------------------------

             Summary: No glyph for U+2032 in font TimesNewRomanPSMT
                 Key: PDFBOX-4643
                 URL: https://issues.apache.org/jira/browse/PDFBOX-4643
             Project: PDFBox
          Issue Type: Bug
          Components: PDModel
    Affects Versions: 2.0.16
            Reporter: hailima


I have the following Java codes for testing PDFBox (2.0.18) and got exception for the unicode U+2032 (prime), but the font i use is "Time New Roman" which should support the unicode, how to fix the issue? thanks

 

import java.io.InputStream;

 

import org.apache.pdfbox.pdmodel.PDDocument;

import org.apache.pdfbox.pdmodel.PDPage;

import org.apache.pdfbox.pdmodel.common.PDRectangle;

import org.apache.pdfbox.pdmodel.font.PDFont;

import org.apache.pdfbox.pdmodel.font.PDType0Font;

 

 

public class PDFFonts {

 

 

public static void main (String args[]) {

try {

 

PDDocument document = new PDDocument();

PDPage page = new PDPage(PDRectangle.A4);

document.addPage(page);

InputStream starWarsFontStream = PDFFonts.class.getResourceAsStream("/times-new-roman.ttf");

 

PDFont font = PDType0Font.load(document,starWarsFontStream, false);

 

float num = font.getStringWidth("atal period (pre-na′tal"); 

System.out.println(num);    

} catch (Exception e) {

e.printStackTrace();

}

}

}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org