[reportlab-users] Incorrect character composition

Marius Gedminas marius at gedmin.as
Wed Apr 15 01:25:21 EDT 2015


On Tue, Apr 14, 2015 at 12:05:04PM -0700, Glenn Linderman wrote:
> 6-7 weeks with no response, for a while I thought the list was dead, but now
> a flurry of messages....
> 
> I guess I didn't actually ask a question, but is this, like kerning, thought
> to be too slow to implement, or is it just that the market for reportlab
> simply doesn't include languages that don't have precomposed glyphs, or
> something else?

When I and Vika originally implemented Unicode + TrueType support in
ReportLab, we didn't implement support for combining characters.  I
don't remember if the TTF/PDF specifications available at that time included
such support.

I guess nobody stepped up to add the missing support since then.

Technical details (that might be wrong if the code changed since 2003,
which it probably did--I wasn't keeping track): ReportLab takes apart
the TTF and builds multiple fonts, each containing a subset of the
original glyphs (up to 256).  These subsets discard any and all TTF
tables not explicitly copied, which I guess include the tables used for
rendering combining characters in a nice way.

> On 2/21/2015 1:18 PM, Glenn Linderman wrote:
> >I've suddenly discovered a need to use Unicode characters that do not fall
> >into the category of "precomposed glyphs", instead being forced to use
> >"combining characters" for certain diacritical marks.
> >
> >However, the combined result from reportlab looks rather stupid compared
> >to the results seen in other programs (browsers, text editors, word
> >processors, etc.).  I even displayed the results in two different PDF
> >viewers, Sumatra and Adobe, before concluding it must be a reportlab
> >thing.
> >
> >The problem is with the characters called  open o  (upper and lower case),
> >and  open e (at least lower case, the upper case version looks better, but
> >that may be more due to the open E being narrower than due to proper
> >handling) when combined with the combining tilde, and other similar
> >diacriticals.
> >
> >In my sample at http://nevcal.com/temporary/openo.pdf I've also included a
> >precomposed ã and Õ as well, for comparison of where the tilde should be
> >placed.  Here are the same characters in email... I note that in my email
> >client (Thunderbind) the precomposed tildes are slightly closer to the
> >characters than the combining tilde, but in the reportlab-generated PDF,
> >the lower case combining tildes are far too high, and those over (wider)
> >upper case characters are not centered.  Times New Roman font in both this
> >email (unless your client or the mailing list strips the fonts) and the
> >PDF.
> >
> >Glenn
> >
> >ɔãɔ̃ÕƆ̃ɛɛ̃Ɛ̃

Marius Gedminas
-- 
What goes up, must come down. Ask any system administrator.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 173 bytes
Desc: Digital signature
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20150415/72755d20/attachment.pgp>


More information about the reportlab-users mailing list