Re: [ft-devel] Re: [ft] Creating an [OT]TF font from BDF font
Damn it. I used > rather than >>. Here are the real patches. iterate_bdf3.patch.bz2 Description: application/bzip iterate_sfnt3.patch.bz2 Description: application/bzip ___ Freetype-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] Re: [ft] Creating an [OT]TF font from BDF font
On Sun, 2005-12-18 at 18:20, Chia-I Wu wrote: > > FT_Get_BDF_Fontname(face) > > FT_Get_BDF_Comments(face) > Couldn't they just be treated like normal properties? Ok, I have removed those entry points and made them behave like normal properties. This is incompatible with previous behavior. But since the previous behavior was inconsistent between BDF & PCF that may not matter. iterate_bdf3.patch.bz2 Description: application/bzip iterate_sfnt3.patch.bz2 Description: application/bzip ___ Freetype-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] Re: [ft] Creating an [OT]TF font from BDF font
On Sun, 2005-12-18 at 18:20, Chia-I Wu wrote: > > FT_Get_BDF_Fontname(face) > > FT_Get_BDF_Comments(face) > Couldn't they just be treated like normal properties? Well they aren't in the bdf file format, they are handled quite differently, so the bdf parser handles them differently. The pcf file format does not contain the comments but does treat the fontname as a normal property. I thought bundling them into the property list might offend some purists. ___ Freetype-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] Re: [ft] Creating an [OT]TF font from BDF font
On Sun, Dec 18, 2005 at 02:07:50PM -0800, George Williams wrote: > On Sat, 2005-12-17 at 18:42, Chia-I Wu wrote: > > I suggest the following APIs, making iterator merely an iterator: > > > > /* to iterate... */ > > FT_Get_BDF_Iterator( face, &iter ); > > while ( FT_Iterare_BDF_Property( face, &iter, &name, &aprop ) ) > > FT_Get_BDF_Property_Count( face ); > > How about: > FT_Get_BDF_PropertyCount(face) Good to me. I was thinking about charmap iteration yesterday and I suggested taking property count out of bdf iterator because charmap iterator cannot know the char count. BTW, if you look into FT_Face, you'll find that `size_list' is an FT_List, `glyph' is a custom list, and `charmaps' is a dynamic array, while they all do the same thing :-) > FT_Iterate_BDF_Property(face,void *,BDF_IteratorFunc) > Calls the iterator function once with each property. > + typedef FT_Error > + (*BDF_IteratorFunc)( FT_Face face, > +void * data, > +const char* prop_name, > +const BDF_PropertyRec* aproperty); s/Iterat(e|or)/ForEach/... well, I must be affected by gtk+ :-) > FT_Get_BDF_Fontname(face) > FT_Get_BDF_Comments(face) Couldn't they just be treated like normal properties? -- Regards, olv ___ Freetype-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] Re: [ft] Creating an [OT]TF font from BDF font
One more thing... Currently when freetype parses a bdf font it throws away any comments in that font. But they contain important info if one wishes to preserve all of a bdf font. So I want access to them. Retaining them in freetype is fairly easy, it's just a parameter passed to the bdf parser. But for almost all uses they are irrelevant and should not be retained. What I'd like to be able to do is make a call before parsing the font which will establish a value for this parameter in the future... but I'm not sure how best to do that -- it's deep inside BDF_Face_Init Any suggestions? ___ Freetype-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] Re: [ft] Creating an [OT]TF font from BDF font
On Sat, 2005-12-17 at 18:42, Chia-I Wu wrote: > I suggest the following APIs, making iterator merely an iterator: > > /* to iterate... */ > FT_Get_BDF_Iterator( face, &iter ); > while ( FT_Iterare_BDF_Property( face, &iter, &name, &aprop ) ) > FT_Get_BDF_Property_Count( face ); How about: FT_Get_BDF_PropertyCount(face) FT_Iterate_BDF_Property(face,void *,BDF_IteratorFunc) Calls the iterator function once with each property. + typedef FT_Error + (*BDF_IteratorFunc)( FT_Face face, +void * data, +const char* prop_name, +const BDF_PropertyRec* aproperty); FT_Get_BDF_Fontname(face) FT_Get_BDF_Comments(face) So ignore the previous patches iterate_bdf2.patch.bz2 Description: application/bzip iterate_sfnt2.patch.bz2 Description: application/bzip ___ Freetype-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] Re: [ft] Creating an [OT]TF font from BDF font
On Sat, 2005-12-17 at 18:42, Chia-I Wu wrote:
> I suggest the following APIs, making iterator merely an iterator:
>
> /* to iterate... */
> FT_Get_BDF_Iterator( face, &iter );
> while ( FT_Iterare_BDF_Property( face, &iter, &name, &aprop ) )
> {
> /* do something; */
> }
>
> /* to get property count... */
> FT_Get_BDF_Property_Count( face );
Is that really an improvement? It means adding three function calls
instead of one, and it isn't compatible with the List_Iterator either.
___
Freetype-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype-devel
[ft-devel] Re: [ft] Creating an [OT]TF font from BDF font
Drat. PCF fonts include the "FONT" keyword and value in the list of properties. Strictly speaking "FONT" is not a bdf property (it comes outside of the STARTPROPERTIES list) -- however to do round trip conversion it is necessary. The value is available internally as face->bdffont->name, but I don't see any API to get this. I see three possibilities: * Add an API to retrieve face->bdffont->name * Add this to the property list on parsing Will make the BDF properties match the PCF ones, but would be incompatible with existing code * Change my new iterator so that it manufactures a fake entry for FONT ___ Freetype-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/freetype-devel
Re: [ft-devel] Re: [ft] Creating an [OT]TF font from BDF font
On Sat, Dec 17, 2005 at 04:01:38PM -0800, George Williams wrote:
> Ok, here is an iterator.
>FT_GetIterate_BDF_Property(FT_Face,BDF_PropertyIteratorRec *aprop)
> To get the first property set,
>aprop->index = 0
> (each call will automagically increment)
>
> aprop->cnt will be set to the number of properties in the face
> aprop->name the name string
> aprop->property standard BDF_PropertyRec with the value.
I suggest the following APIs, making iterator merely an iterator:
/* to iterate... */
FT_Get_BDF_Iterator( face, &iter );
while ( FT_Iterare_BDF_Property( face, &iter, &name, &aprop ) )
{
/* do something; */
}
/* to get property count... */
FT_Get_BDF_Property_Count( face );
--
Regards,
olv
___
Freetype-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype-devel
[ft-devel] Re: [ft] Creating an [OT]TF font from BDF font
On Fri, 2005-12-16 at 23:22, Werner LEMBERG wrote: > > Is there some way to look at all the properties without having to > > guess which ones are present? > > > > If not, I see four choices: > > > > * Add a new API call, something like FT_Get_BDF_NextProperty But it > >seems silly to extend the API for a format we are trying to get > >rid of. So that doesn't seem like a good idea > > Well, actually I like this idea -- even if BDF will be of less > importance in the future, there are far too many BDF still out, and > FreeType's support should be adequate (it's not necessary to make it > deluxe :-). Can you provide some code? Ok, here is an iterator. FT_GetIterate_BDF_Property(FT_Face,BDF_PropertyIteratorRec *aprop) To get the first property set, aprop->index = 0 (each call will automagically increment) aprop->cnt will be set to the number of properties in the face aprop->name the name string aprop->property standard BDF_PropertyRec with the value. I include two patches, iterate_bdf.patch.bz2 handles bdf & pcf fonts sfnt.patch.bz2 is based on David's sfnt bdf code (and handles sfnts). iterate_bdf.patch.bz2 Description: application/bzip sfnt.patch.bz2 Description: application/bzip ___ Freetype-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/freetype-devel
