[Cairo] Re: [xsvg] cairo_text_extents ?

Bill Spitzak spitzak at d2.com
Fri Dec 5 11:36:48 PST 2003


On Friday 05 December 2003 10:16 am, Carl Worth wrote:

>  > I want to allow a platform-specific "configuration" program that says
>  > "the default font is this". As designed I CANNOT do this unless every
>  > program uses the platform-specific interface.
>
> I don't think I've understood your comment here. Is it that you would
> like an interface that would enumerate the acceptable family names
> that could be passed to cairo_select_font? We could probably add that
> without going too far over the slippery slope.

The enumeration interface would be very nice, and also a requirement for a 
usable Cairo. It should not be hard, because I don't think any guarantee that 
it returns *everything* is required. But that is not what I am talking about.

When you run KDE/Gnome, there is a "configuration" panel that lets the user 
select things such as the default font to use. I think the user would be 
extremely disappointed if this did not allow them to choose all possible 
fonts on their platform by using the device-specific interface. For instance 
the device may provide controls for the weight or other attributes. It would 
be very nice if a portable application could use such configuration data. It 
may also be very useful to drag & drop fonts from one program to another 
(this would make font-selection panels reusable and allow device-specific 
font selection even for non-device-aware programs), and to store fonts 
generated by a device-specific program into files readable by 
non-device-specific programs.

I think this means there *must* be a public "turn a string into a 
device-specific font" interface somewhere. Unless cairo provides this, we 
have just added the requirement for a second "font naming" interface. Having 
two interfaces that do the same thing is a *bad* idea.

Notice that there is no requirement that the a program be able to 
*understand* the string. Only the device-specific interface needs to do that. 
Therefore I do not see this as a slippery-slope.

My current recommendation for this string is to have the following form:

"cairo-name : gibberish"

Where ':' is some seperating character that is not allowed in a cairo font 
name. "gibberish" is an unreadable hex dump of internal data from the 
device-specific interface, including an id for what device it is. This data 
may completely define the font, or the device-specific interface can use both 
it and the cairo-name. Any other device will recognize that it does not 
understand the gibberish and will select the font based on the cairo name 
only.

-- 
                   ,~,~,~,~ ~ ~ ~ ~
     /\_       _|_========___         Bill Spitzak
 ~~~/\/\\~~~~~~\____________/~~~~~~~~ spitzak at d2.com




More information about the cairo mailing list