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

Maruan Sahyoun commented on PDFBOX-4189:
----------------------------------------

[~tilman] [~paawak] could we get a method which returns the glyphs/ids/code to 
use together with the metrics information for a string? This way we could get 
the neccessary information to do line breaking etc in one go instead of calling 
{{PDFont.getStringWidth()}} {{PDFont.getWidths()}} and then  doing the same 
again when {{showText}} is called by running through {{PDFont.encode()}}.

There might be additional information we store such as the later on such as 
baseline adjustment. 

We could utilize {{java.text.AttributedString}} with our own implementation of 
{{java.text.AttributedCharacterIterator}} e.g. similar to 
{{java.awt.font.TextAttribute}}. One issue I see is with subsetting as when 
getting the font information you won't know  that the text will be shown e.g. 
if the text doesn't fit within a text box one might drop some of the characters.

It would also need an additional version of {{showText}} as we already have the 
information for the encoded text. 

WDYT?

> Enable PDF creation with Indian languages, by reading and utilizing the GSUB 
> table
> ----------------------------------------------------------------------------------
>
>                 Key: PDFBOX-4189
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4189
>             Project: PDFBox
>          Issue Type: New Feature
>          Components: FontBox, PDModel
>            Reporter: Palash Ray
>            Priority: Major
>         Attachments: Bengali-text-after.pdf, Bengali-text-before.pdf, 
> BengaliPdfGenerationHelloWorld.java, bengali-example.pdf, 
> bengali-example2.pdf, bengali-example3.pdf, committed.patch, screenshot.png
>
>   Original Estimate: 336h
>  Remaining Estimate: 336h
>
> Implemented proper rendering of Indian languages, which need extensive Glyph 
> substitution. The GSUB table has been read and used effectively to replace 
> some compound words with their respective Glyphs. All tests are passing. I 
> have tested this for the Bengali font. Please review these changes and let me 
> know if it makes sense to incorporate these.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to