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

Volker Kunert commented on PDFBOX-6306:
---------------------------------------

No, this was not solved. My PR [https://github.com/apache/pdfbox/pull/495] was 
not approved. So at many places in PDFBox and in OpenHtmlToPDF the method 
PDType0Font.getStringWidth is called and returning a wrong width. 

A prototype implementation using this for OpenHtmlToPdf can be found in 
[https://github.com/vk-github18/openhtmltopdf-vk/tree/b1.1.105-glyphlayout-pdfont-works/openhtmltopdf-pdfbox-glyphlayout-awt/src/main/java/com/openhtmltopdf/pdfbox/glyphlayout/awt]

To enable this solution, the proposed changes are needed.

Of course, it would be great, if we could find a solution in PDFBox, but last 
time we did not agree on this, so I am proposing to enable possible solutions 
as extension outside of PDFBox.

> Make PDTYpe0Font and GlyphLayout* extensible
> --------------------------------------------
>
>                 Key: PDFBOX-6306
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6306
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 3.0.8 PDFBox
>            Reporter: Volker Kunert
>            Priority: Major
>             Fix For: 3.0.9 PDFBox, 4.0.0
>
>
> See [https://github.com/apache/pdfbox/pull/561]
>  
> This change adds extension points to the PDFBox glyph-layout processors and 
> font loaders, allowing subclasses to customize font creation without 
> replacing the existing loading and layout flow.
> This is meant to help the integration in OpenHtmlToPDF.
> h2. Changes
>  * Add overridable font-loader factory methods to {{GlyphLayoutProcessorAwt}} 
> and {{{}GlyphLayoutProcessorFop{}}}.
>  * Add overridable {{loadPDType0Font(...)}} methods to the AWT and FOP font 
> loaders.
>  * Make the {{PDType0Font}} constructor that accepts a {{TrueTypeFont}} 
> {{{}protected{}}}, enabling subclasses to create specialized Type 0 fonts.
>  * Make {{supportsFont(...)}} verify that the supplied font is a 
> {{PDType0Font}} before checking loader support.
>  *  



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to