[ 
https://issues.apache.org/jira/browse/PDFBOX-972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005599#comment-13005599
 ] 

Timo Boehme commented on PDFBOX-972:
------------------------------------

Here are the methods which need to be added to PDType1Font:

    /**
     * {@inheritDoc}
     */
    @Override
    public float getFontWidth( final byte[] bytes, final int offset, final int 
length ) throws IOException
    {
        return ( type1CFont != null ) ? type1CFont.getFontWidth( bytes, offset, 
length ) : super.getFontWidth( bytes, offset, length );
    }
    
    /**
     * {@inheritDoc}
     */
    @Override
    public float getFontHeight( byte[] bytes, int offset, int length ) throws 
IOException
    {
        return ( type1CFont != null ) ? type1CFont.getFontHeight( bytes, 
offset, length ) : super.getFontHeight( bytes, offset, length ); 
    }
    
    /**
     * {@inheritDoc}
     */
    @Override
    public float getAverageFontWidth() throws IOException
    {
        return ( type1CFont != null ) ? type1CFont.getAverageFontWidth() : 
super.getAverageFontWidth(); 
    }
    
    /**
     * {@inheritDoc}
     */
    @Override
    public float getStringWidth( String string ) throws IOException
    {
        return ( type1CFont != null ) ? type1CFont.getStringWidth( string ) : 
super.getStringWidth( string ); 
    }
    
    /**
     * {@inheritDoc}
     */
    @Override
    public PDRectangle getFontBoundingBox() throws IOException
    {
        return ( type1CFont != null ) ? type1CFont.getFontBoundingBox() : 
super.getFontBoundingBox(); 
    }


> Specific Type1C methods not used anymore
> ----------------------------------------
>
>                 Key: PDFBOX-972
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-972
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 1.6.0
>            Reporter: Timo Boehme
>
> In one of the last releases the PDFontFactory changed  so that for Type1C 
> fonts a PDType1Font will be created and not as before a PDType1CFont. While 
> PDType1Font will internally instantiate a PDType1CFont several of the methods 
> which PDType1CFont overrides are now hidden and not used (instead the 
> PDSimpleFont variants are used).
> I will add the necessary methods in an attachment which calls the appropriate 
> methods.
> However having all these type specific switches it seems to be a better 
> solution to subclass PDType1CFont from PDType1Font.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to