[cairo] Font options patch, first draft

Owen Taylor otaylor at redhat.com
Thu Jul 21 06:49:03 PDT 2005


On Tue, 2005-07-19 at 10:39 -0700, Bill Spitzak wrote:

> True, I was pretty vague about the format of the string, except I want 
> PostScript/Quartz names to work as a subset of possible names.
> 
> Here is my description:

> The name is a utf8 string, although only characters less than 128 have 
> any meaning other than parts of identifiers, so the parser can treat it 
> as bytes. Delimiters between words are any sequence of whitespace ascii 
> bytes. The first word must be a name and is considered the value for 
> "family", all the rest of the words can be name or name=value. A name 
> can contain any byte other than = and whitespace. A value can contain 
> any byte other than whitespace. Use of bytes other than ascii letters, 
> numbers, whitespace, and a few punctuation marks, is *discouraged*, but 
> not illegal.
> 
> (biggest problem with this is that spaces are not allowed in family 
> names or other values. However I think substituting underscore should be 
> acceptable, the GUI can substitute these back & forth. Putting in a utf8 
> encoded non-breaking space character would work as well).
> 
> There are no errors. Unrecognized names are ignored. Values are forced 
> to the nearest legal value (if numeric) or otherwise mangled to a legal 
> value or ignored for text ones. There may be back-end specific 
> interfaces to parse a name and report if any errors were found, but the 
> portable interface is completely incapable of returning an error.

I think you are confusing font names with font options. What's under
discussion here is how to handle things like turning antialiasing on
or off by user preference set for the target surface. (By X display
properties, say)

You might be suggesting that

 "/TimesRoman-12"

Gets transformed into:

 "/TimesRoman-12 antialiasing=False"

in some fashion, but I'm really not of the opinion that trying to 
transform strings like that is a good idea

String forms of font names are of course useful, but they aren't
good as the *only* form for a font name; I think for a small simple
API cairo_select_font() is fine.

Regards,
							Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050721/3f332bb3/attachment.pgp


More information about the cairo mailing list