You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Timo Boehme (JIRA)" <ji...@apache.org> on 2011/03/11 12:08:59 UTC

[jira] Created: (PDFBOX-972) Specific Type1C methods not used anymore

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

[jira] Commented: (PDFBOX-972) Specific Type1C methods not used anymore

Posted by "Timo Boehme (JIRA)" <ji...@apache.org>.
    [ 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

[jira] [Commented] (PDFBOX-972) Specific Type1C methods not used anymore

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011784#comment-13011784 ] 

Andreas Lehmkühler commented on PDFBOX-972:
-------------------------------------------

All these information should be part of the font descriptor/dictionary of the type1 font, so that it isn't neccessary to get those from the embedded type1C font by delegating the method calls. Or do you have a counter example which doesn't work as assumed?

> 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