tor.andersson | 2 Jul 2002 00:04
Picon
Picon
Favicon

fontconfig fuzzy matching

Hi all,

I use fontconfig to find font files for my PDF viewer.
However, oftimes the standard windows fonts (Times New Roman & co)
are not embedded in the PDF, nor are the standard 14 fonts used.
Instead, the PDF specifies a postscript font name, or in the
case of truetype fonts, a mangled name:

(§5.5.2 of pdfref.pdf)
... derive a PostScript name from the name by which the font is
known in the host operating system: on a Windows system, it is
based on the IfFaceName field in a LOGFONT structure; in the
Mac OS, it is based on the name of the FOND resource. If the name
contains any spaces, the spaces are removed.

further: ... a comma and the style name (one of Bold, Italic
or BoldItalic) are appended to the font name.

For example: "TimesNewRoman,Italic"

How to best create a matching pattern, given this?

Can fontconfig be extended to do fuzzy name matches?

/tor
Keith Packard | 2 Jul 2002 01:21
Favicon
Gravatar

Re: fontconfig fuzzy matching


Around 0 o'clock on Jul 2, tor.andersson <at> dsek.lth.se wrote:

> For example: "TimesNewRoman,Italic"
> 
> How to best create a matching pattern, given this?

Can you get the spaces stuck back into the family name?  If so, then juse 
use:

	Times New Roman:style=italic

and Xft will happily locate the right font.

If this isn't possible, then we could extend the current family matching 
algorithm to ignore white space, or at least families which differ only in 
whitespace match better than familes which don't match at all.

Keith Packard        XFree86 Core Team        HP Cambridge Research Lab
tor.andersson | 2 Jul 2002 02:08
Picon
Picon
Favicon

Re: fontconfig fuzzy matching

Keith Packard <keithp <at> keithp.com> wrote:

> Can you get the spaces stuck back into the family name?  If so, then juse 
> use:

Not very likely, not without fragile heuristics.

> If this isn't possible, then we could extend the current family matching 
> algorithm to ignore white space, or at least families which differ only in 
> whitespace match better than familes which don't match at all.

I think that would be the best way. Also, it might be useful to consider
matching sub-strings (so Garamond would match AGaramond, or ITC Garamond,
for example), but that is really more a fonts.conf issue.

/tor
Liam R. E. Quin | 2 Jul 2002 02:37
Favicon
Gravatar

Re: fontconfig fuzzy matching

On Mon, 2002-07-01 at 20:08, tor.andersson <at> dsek.lth.se wrote:
> [...] Also, it might be useful to consider
> matching sub-strings (so Garamond would match AGaramond, or ITC Garamond,
> for example), but that is really more a fonts.conf issue.

Watch that FF Symbol is not a possible substitute for Symbol --
one is a text font (sans serif) and the other a symbol/math font.

So the foundry label should not usually be disregarded, except
possibly as a last resort.  Unfortuantely, looking at the font
encoding tends not to be reliable with Type 1 fonts.

Doesn't Acrobat come with a font substittion database? I forget.
Nor do I know whether Adobe would have any interest in opening
their font substitution technology.

Liam
Lawrence Lee (Shanghai | 2 Jul 2002 13:06
Picon

Question about DGA

hi,all
I'm studying the Graphics Card Driver in xwindow. I'm very confused with
DGA(direct Graphics Architecture). Why an application needs DGA?Is DGA more
faster? Like set mode, why xfree86 provides the DGA method?
Thanks
Lawrence Lee (Shanghai | 4 Jul 2002 03:30
Picon

RE: Question about DGA

Thanks
Yes, if the client can render in the frame buffer directly it will improve
the speed greatly. But why DGA provides other methods like SET MODE? I think
there may be two reasons:
1.   The client can't SET MODE through X lib
2.   The speed using DGA is faster than througn X lib(if it has).
Which is right? and maybe other answers?

-----Original Message-----
From: Mark Vojkovich [mailto:MVojkovich <at> nvidia.com]
Sent: Thursday, July 04, 2002 2:09 AM
To: Lawrence Lee (Shanghai)
Subject: RE: [Render] Question about DGA

On Wed, 3 Jul 2002, Lawrence Lee (Shanghai) wrote:

> Thanks 
> But how a client from another machine render the frame buffer directly? Or
> the dga is using only by the client in local host?

   It only works for local clients.  There are also security concerns
because for most (all at the moment, but in theory not all need to be
this way) operating systems because applications need to run with root
permissions in order to open /dev/mem so they can map the framebuffer.

			Mark.

> 
> -----Original Message-----
> From: Mark Vojkovich [mailto:MVojkovich <at> nvidia.com]
(Continue reading)

Tor Andersson | 4 Jul 2002 10:45
Picon
Picon
Favicon

Re: fontconfig fuzzy matching

"Liam R. E. Quin" <liam <at> holoweb.net> wrote:

> On Mon, 2002-07-01 at 20:08, tor.andersson <at> dsek.lth.se wrote:
> > [...] Also, it might be useful to consider
> > matching sub-strings (so Garamond would match AGaramond, or ITC Garamond,
> > for example), but that is really more a fonts.conf issue.
>
> Watch that FF Symbol is not a possible substitute for Symbol --
> one is a text font (sans serif) and the other a symbol/math font.

Right. Didn't think of that. My bad.  Matching fonts ignoring
whitespace is still necessary though.

> Doesn't Acrobat come with a font substittion database? I forget.
> Nor do I know whether Adobe would have any interest in opening
> their font substitution technology.

All I know is that if Acrobat can't find the font in question,
it synthesizes a new one from a MM Type1 font based on the
style and character metrics that are always present in the PDF
FontDescriptor.

Ketih, do you have time to add matching that ignores whitespace
for an upcoming release? It's no rush, and if you don't have time
just say so and I'll try adding it myself.

/tor
Keith Packard | 4 Jul 2002 18:43
Favicon
Gravatar

Re: fontconfig fuzzy matching


Around 10 o'clock on Jul 4, Tor Andersson wrote:

> Ketih, do you have time to add matching that ignores whitespace
> for an upcoming release? It's no rush, and if you don't have time
> just say so and I'll try adding it myself.

I won't have time for a couple of weeks, but it should be quite easy to do 
so.  In fontconfig/src/fcmatch.c there is a function FcCompareString which
you will want to whack.

Keith Packard        XFree86 Core Team        HP Cambridge Research Lab
Vadim Plessky | 5 Jul 2002 09:16
Picon

Re: Experimental Xft + gamma correction patch

On Monday 24 June 2002 1:31 am, Owen Taylor wrote:
|  I've put up some screenshots at:
|
|   http://people.redhat.com/otaylor/fonts/gamma-screenshots/
|

Owen,

In my opinion, screenshot "With improved hints and gamma correction" (which I 
believe you rfer to) has serious renderin artefacts.
Width (*boldness*) of diagonal stems (v w x y z V W X Y X Z ) and curved 
glyphs (a b c d g o p q s B C D G O Q S 3 5 6 7 8 9) is inconsistent with 
widths of horizontal and vertical stems.
I think rendering on screenshot "With improved hints" (no.2) is better than on 
screenshot with gamma correction (no.3) 

|  I also discovered a major one-character bug in my last patch
|  (*, /, what's the difference...) that prevented it from
|  working with anything but a black foreground. New fixed
|  version is attached.
|
|  Regards,
|                                          Owen

--

-- 

Vadim Plessky
http://kde2.newmail.ru  (English)
33 Window Decorations and 6 Widget Styles for KDE
http://kde2.newmail.ru/kde_themes.html
(Continue reading)

Vadim Plessky | 5 Jul 2002 09:21
Picon

Re: Less anti-aliasing

On Saturday 22 June 2002 11:37 pm, Elias Penttilä wrote:
|  Hi there,
|  don't know if this is the right list, but:
|  Looking at some magnified screenshots from anti-aliased GNOME/KDE/other
|  desktops and comparing it with the "smoothing" (not ClearType) from
|  Windows-products I see that XFree86 does anti-aliasing to straight lines
|  aswell. My eyes can't stand those blurred fonts and that's why I'm asking
| if it's possible to only smooth out the curves in XFree86.

Can you explain what do you refer to?
AFAIK KDE doesn't have such behavior. 
GNOME1 doesn't have anti-aliasing at all. 
Nautilus anti-aliases fonts without applying hints, which results in *blurred 
fonts* in Nautilus (same way as MacOS X).

--

-- 

Vadim Plessky
http://kde2.newmail.ru  (English)
33 Window Decorations and 6 Widget Styles for KDE
http://kde2.newmail.ru/kde_themes.html
KDE mini-Themes
http://kde2.newmail.ru/themes/

Gmane