You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "John Hewson (JIRA)" <ji...@apache.org> on 2014/10/14 10:30:34 UTC

[jira] [Closed] (PDFBOX-2013) Please extend PDTrueTypeFont API

     [ https://issues.apache.org/jira/browse/PDFBOX-2013?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Hewson closed PDFBOX-2013.
-------------------------------
    Resolution: Won't Fix

This has been consolidated into PDFBOX-922.

> Please extend PDTrueTypeFont API
> --------------------------------
>
>                 Key: PDFBOX-2013
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2013
>             Project: PDFBox
>          Issue Type: Wish
>          Components: PDModel
>    Affects Versions: 1.8.4, 2.0.0
>            Reporter: Philip Helger
>             Fix For: 2.0.0
>
>
> Please extend the API to get the default width and the Unicode CMAP table (Patch for 2.0.0 SNAPSHOT):
> ### Eclipse Workspace Patch 1.0
> #P pdfbox
> Index: src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
> ===================================================================
> --- src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java	(revision 1583927)
> +++ src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java	(working copy)
> @@ -67,6 +67,9 @@
>  
>      private static Properties externalFonts = new Properties();
>      private static Map<String, TrueTypeFont> loadedExternalFonts = new HashMap<String, TrueTypeFont>();
> +    
> +    private int m_nDefaultWidth = -1;
> +    private CMAPEncodingEntry m_aUnicodeMap = null;
>  
>      static
>      {
> @@ -352,10 +355,11 @@
>              {
>                  widths.add(defaultWidth);
>              }
> +
>              // Encoding singleton to have acces to the chglyph name to
>              // unicode cpoint point mapping of Adobe's glyphlist.txt
>              Encoding glyphlist = WinAnsiEncoding.INSTANCE;
> -
> +            
>              // A character code is mapped to a glyph name via the provided
>              // font encoding. Afterwards, the glyph name is translated to a
>              // glyph ID.
> @@ -380,9 +384,12 @@
>                      }
>                  }
>              }
> +            
>              setWidths(widths);
>              setFirstChar(firstChar);
>              setLastChar(lastChar);
> +            setDefaultWidth(defaultWidth);
> +            setUnicodeMap(uniMap);
>          }
>          finally
>          {
> @@ -393,6 +400,26 @@
>          }
>      }
>  
> +    public int getDefaultWidth ()
> +    {
> +      return m_nDefaultWidth;
> +    }
> +
> +    public void setDefaultWidth (int defaultWidth)
> +    {
> +      m_nDefaultWidth = defaultWidth;
> +    }
> +
> +    public CMAPEncodingEntry getUnicodeMap ()
> +    {
> +      return m_aUnicodeMap;
> +    }
> +    
> +    public void setUnicodeMap (CMAPEncodingEntry aUnicodeMap)
> +    {
> +      m_aUnicodeMap = aUnicodeMap;
> +    }
> +    
>      /**
>       * Permit to load an external TTF Font program file
>       * 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)