Re: Local patching of fonts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le Jeu 5 décembre 2013 13:29, Paul Flo Williams a écrit :
> I've recently been looking at the prospect of locally patching font files
> for Fedora, prompted by two things:

> 2. Bug 706559, "Font variants not used correctly"[2], refers to a font
> family that contains more than just the R,B,I,BI styles and shows that
> they are not well-treated by applications including LibreOffice.

More than R,B,I,BI is fine and should be encouraged as long as the style
names conform to WWS. Some apps do not understand WWS, true but other apps
do not understand any style or fail on new font formats and we don't give
up on them. IMHO WWS has been the reasonable middle ground for some years.

DejaVu uses more than R,B,I,BI and should have shaken up WWS bugs in most
important apps by now. The fonts Adobe released also use more than
R,B,I,BI to put more pressure on app authors.

> 3. Fontconfig scripts, which most of us just hack from the templates
> provided by Nicolas Mailhot because ... well, I certainly couldn't write
> the DejaVu ones from scratch.

I admit I spent quite a lot of time pestering Behdad on IRC to get advice :p

> There is the additional problem that not all
> applications might use Fontconfig. (I might be misremembering but doesn't
> Firefox do something special?)

Not interesting case, we want applications to use fontconfig, there are so
many things that break otherwise it's counter-productive to help
non-fontconfig users.

But of course fixing the font files is better than work-arounding them at
fontconfig level.

> The problem of embedding flags is now being addressed by the packaging of
> a simple tool called "ttembed" which just touches OS/2.fsType and
> checksums, nothing else.[4]

That was great!

> I was considering the construction of another, more general, tool that
> would perform adjustments to other OS/2 or name table fields in-place[*],
> adjusting checksums as necessary in order to keep the font consistent, but
> specifically not decompiling the font or attempting to do glyph or GPOS
> type changes.
>
> The proposed method would be to write a very simple recipe for the font
> changes, like this:

If you want to work on this that would be terrific. Ideally you'd need a
tool with two modes :

1. analysis mode: read a font file, try to guess correct WWS naming
(consistent with MS paper and existing metadata), print it. There is
already a crude name-guessing script in repo-font-audit (but it does not
check if the suggested weights & widths are consistent with the font
contents)

2. fix mode: given a font file, a family and WWS font name in input, fixes
all layers of metadata to be consistent with the proposed naming. Aborts
if naming is not WWS-compliant.

3. "automated" mode : string steps 1 and 2

That's about the most complex workflow you can propose to Fedora
packagers. Don't expect them to know the different opentype metadata
layers, just fix all the layers in one go (and add the missing ones).
Provide a way for translators to contribute translations of standard style
names, and inject all the translations the tools knows of at fix time.

That will harm interop in the case of very badly named fonts, because the
font in Fedora won't have the bugs people workaround in other systems, but
the only way to avoid this would be to add renaming heuristics at
fontconfig level, like Microsoft did (keeping the bugs in the fonts but
fixing the naming displayed in their apps). We hoped for those for years,
time to move on if you're ready to work on the problem.

It's useless to preserve Windows/Mac naming, depending on the OS the font
creator used it's almost certain that the one he didn't use has broken
naming. Better to have completely correct and consistent naming than
slightly-broken-in-some-cases fonts (at the oldest naming layer style
names will end up fully or in part in the font name which is ok as long as
it's done consistently)

You also need a tool to fix the copyright/licensing/distribution fields as
those are often wrong.

I think that in many cases upstreams will even adopt the result as I
suspect reluctance to fix the fonts is directly caused by atrocious
metadata edition UI in their editor of choice.

I'm really sad to be almost unavailable while such exciting changes happen
in Fedora fonts:(

Regards,

-- 
Nicolas Mailhot

_______________________________________________
fonts mailing list
fonts@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/fonts
http://fonts.fedoraproject.org/





[Index of Archives]     [Fedora Users]     [Font Configuration]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux