Bug 458476 - [RFE] Support OpenType CFF fonts
Summary: [RFE] Support OpenType CFF fonts
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: openoffice.org
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Caolan McNamara
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-08-08 18:15 UTC by Vasile Gaburici
Modified: 2009-08-19 15:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-08-19 15:53:08 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
half assed patch to get started (2.56 KB, patch)
2008-08-09 12:37 UTC, Caolan McNamara
no flags Details | Diff
upstreams version, targeted for 3.2 (12.56 KB, application/octet-stream)
2008-08-09 13:32 UTC, Caolan McNamara
no flags Details


Links
System ID Private Priority Status Summary Last Updated
OpenOffice.org 43029 0 None None None Never

Description Vasile Gaburici 2008-08-08 18:15:42 UTC
Since it impacts a lot of Fedora users, I decided to open this bug to keep track of the upstream progress (or lack thereof) w.r.t. OpenType CFF font support. Note that OpenType fonts of the TrueType flavor are supported in OOo, only the PostScript Type 2 (CFF) variety are not. This pretty baffling, since PostScript Type 1 fonts are supported, and the conversion between the two formats is pretty straightforward.

I'm not sure what's the technical reason why OOo doesn't show CFF fonts in its menu. XeTeX, which also uses ICU, has no problem with them. It's true that Jonathan Kew modified ICU 4.0 to a certain extent for XeTeX's purposes. Perhaps someone that knows who to ping at Sun about this can take action...

Comment 1 Caolan McNamara 2008-08-08 23:43:56 UTC
You seem to suggest that there's an open upstream OOo bug for this, do you know the id for it ? And what fonts do we have in Fedora that can be used to test this ?

Comment 2 Vasile Gaburici 2008-08-09 00:31:21 UTC
(In reply to comment #1)
> You seem to suggest that there's an open upstream OOo bug for this, do you
> the id for it ? 

No CFF support:
http://qa.openoffice.org/issues/show_bug.cgi?id=78858
http://qa.openoffice.org/issues/show_bug.cgi?id=43029

Poor OpenType TT support:
http://qa.openoffice.org/issues/show_bug.cgi?id=78749
http://qa.openoffice.org/issues/show_bug.cgi?id=16032
http://qa.openoffice.org/issues/show_bug.cgi?id=79878

The cairo hack:
http://qa.openoffice.org/issues/show_bug.cgi?id=88613

> And what fonts do we have in Fedora that can be used to test this ?

All the CFF fonts that come with TeXLive: the Latin Modern family, the Gyre family and Antykwa Toruńska. They're packaged in texlive-texmf-fonts, but by some incredible oversight, they're not added to fontconfig's database, so most people outside the TeX world ignore their existence; see bug 456580. TeXLive 2008 has a few more, but due to a radical change in its installer the chances of seeing it in F10 are slim.

Also, all free fonts done in fontforge can be instantly exported to CFF since fontforge sfd natively stores cubic curves. We had pleas from font designers to quit preferring the TT format becuause it causes a lot more work for them; generating a usable TT font from sfd is a 10-step process; I can forward you the email with the steps...

Btw, you should probably add yourself to fedora-fonts-list. A decision has been made there to prefer OpenType CFF fonts in Fedora:
http://fedoraproject.org/wiki/Choosing_the_right_font_format_to_package

Comment 3 Caolan McNamara 2008-08-09 11:44:33 UTC
For http://qa.openoffice.org/issues/show_bug.cgi?id=79878, Condensed, Expanded, etc fonts are covered by bug #436520 which dtardon is working on.

OOo discovers fonts through fontconfig, so if fontconfig doesn't know about them then we don't have a chance to even get started on using them. But I'll have a look at what we could do to use them assuming that they would get found

Comment 4 Caolan McNamara 2008-08-09 12:37:55 UTC
Created attachment 313871 [details]
half assed patch to get started

Comment 5 Caolan McNamara 2008-08-09 13:32:59 UTC
Created attachment 313875 [details]
upstreams version, targeted for 3.2

so upstream already has that much for layout the font displaying it, what's missing is the printing and pdf export portion apparently

Comment 6 Vasile Gaburici 2008-08-09 17:01:02 UTC
(In reply to comment #3)
> For http://qa.openoffice.org/issues/show_bug.cgi?id=79878, Condensed, Expanded,
> etc fonts are covered by bug #436520 which dtardon is working on.
> 
> OOo discovers fonts through fontconfig, so if fontconfig doesn't know about
> them then we don't have a chance to even get started on using them. But I'll
> have a look at what we could do to use them assuming that they would get found

XeTeX, which uses fontconfig and ICU too, but has no problem finding them. There are two ways to name an OpenType fonts, a legacy name/style and a "preferred" (read new) name/style, which supports a lot of weights (ExtraLight etc.). XeTeX actually recognizes only the (new) preferred names, but this is by design [https://sourceforge.net/tracker/?func=detail&atid=951385&aid=2035832&group_id=194926]. So, you can't blame this on fontconfig; fc-list shows both the preferred and legacy names; the data structure has separate entries. XeTeX did have to patch ICU in some places (it uses a modified version), but I don't know if this has anything to do with font names. You can ask Jonathan Kew...

Comment 7 Caolan McNamara 2008-08-09 17:16:12 UTC
"if fontconfig doesn't know about them then we don't have a chance to even get started on using them." refers to there not being any .otf fonts in the default font dirs. Once they are added, then Patch #5 takes care of finding and using them for documents and on screen, with only font embedding for printing and pdf export then missing.

Comment 8 Vasile Gaburici 2008-08-09 17:34:47 UTC
(In reply to comment #5)
> Created an attachment (id=313875) [details]
> upstreams version, targeted for 3.2
> 
> so upstream already has that much for layout the font displaying it, what's
> missing is the printing and pdf export portion apparently

A problem solved a couple of year back in XeTeX. The solution is not ideal, but works ok in practice: CFF fonts get converted on the fly to CID-keyed Type 1 fonts (/CIDFontType0); the embedding does not use a /FontFile3 Subtype key, which is the direct way to embed a CFF font in a PDF.

Comment 9 Vasile Gaburici 2008-08-09 18:06:49 UTC
(In reply to comment #8)
> (In reply to comment #5)
> > Created an attachment (id=313875) [details] [details]
> > upstreams version, targeted for 3.2
> > 
> > so upstream already has that much for layout the font displaying it, what's
> > missing is the printing and pdf export portion apparently
> 
> A problem solved a couple of year back in XeTeX. The solution is not ideal, but
> works ok in practice: CFF fonts get converted on the fly to CID-keyed Type 1
> fonts (/CIDFontType0); the embedding does not use a /FontFile3 Subtype key,
> which is the direct way to embed a CFF font in a PDF.

Correction: XeTeX does embed CFF fonts without conversion. I was confused because the /Subtype key comes after the (long) /CIDSet business, and it uses /Subtype/CIDFontType0C for /FontFile3, not /Subtype/OpenType. The reason why XeTeX uses /CIDFontType0C is that the /OpenType subtype requires PDF-1.6, while
/CIDFontType0C works in PDF-1.3, which is what XeTeX (xdvipdfmx actually) outupts.

To further add to the confusion, evince displays CFF fonts embedded with /CIDFontType0C as "Type 1C (CID)" in the font info box, while pdffonts lists them as "CID Type 0C".

Comment 10 Vasile Gaburici 2008-08-09 18:13:11 UTC
(In reply to comment #9)
> 
> Correction: XeTeX does embed CFF fonts without conversion. I was confused
> because the /Subtype key comes after the (long) /CIDSet business, and it uses
> /Subtype/CIDFontType0C for /FontFile3, not /Subtype/OpenType. The reason why
> XeTeX uses /CIDFontType0C is that the /OpenType subtype requires PDF-1.6, while
> /CIDFontType0C works in PDF-1.3, which is what XeTeX (xdvipdfmx actually)
> outupts.
> 
> To further add to the confusion, evince displays CFF fonts embedded with
> /CIDFontType0C as "Type 1C (CID)" in the font info box, while pdffonts lists
> them as "CID Type 0C".

Addendum: if one actually wants to include a CFF font *without* a CID table, then PDF-1.6 is a must because /Subtype/OpenType is the only correct description for it. The PDF spec is mess when in comes to fonts...

Comment 11 Caolan McNamara 2008-08-30 15:59:35 UTC
hdu tells me that he has this working, and scheduled for 3.1

Comment 12 Caolan McNamara 2009-08-19 15:53:08 UTC
ok, fixed upstream for 3.2. Tricky to backport, so setting as closed->upstream and we'll pick it up when we move to 3.2


Note You need to log in before you can comment on or make changes to this bug.