[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freetype] FreeType API extension request
From: |
David Turner |
Subject: |
Re: [Freetype] FreeType API extension request |
Date: |
Wed, 29 May 2002 00:44:07 +0200 |
Hi J.
I just commited the following extensions to the CVS for
your own use. Please test them and thell me what you think
about them:
in FT_TYPE1_TABLES_H, there are now two new APIs:
FT_Int FT_Has_PS_Glyph_Names( face )
which returns TRUE whenever the glyph names in a given
face come from a Postscript-based font format. This
currently means "Type 1" and "CFF" for now.
it may be possible to hack the SFNT/TrueType driver to
recognize correct glyph name tables. However, since these
are called "post" tables in the spec, I don't think that
the name of this function would need to change then :-)
FT_Error FT_Get_PS_Font_Info( face, &font_info )
which retrieves the font info structure of a given
Postscript-based font (for now, only works with "type1"
fonts, but I could extend it to support "cff", "cid" or
even "type42" fonts as well, if there is a need for it.
note that I don't like the FT_Type1_Tag much, a unique
function per table type seems better since it avoids
"generic" pointer casts (I recognize that FT_Get_Sfnt_Table
is also a mistake)
the sources for these new functions are in "src/base/fttype1.c"
a new header file, named FT_XFREE86_H contains the new API
(it's really include/freetype/ftxf86.h by the way):
const char* FT_Get_X11_Font_Format( face )
which returns an X11 FONT_PROPERTY compatible string describing
the font format. I prefered to put this in an XFree86 specific
header file, since I don't want people to begin using it
to test font formats (a better API should come soon, my intent
was to provide something quickly for your needs)
source found in "src/base/ftxf86.c". Other XFree86 specific
things could come here as well...
I hope you'll find these additions useful. Note that the additional
source code to implement them is _very_ hackish. However, since a
great deal of changes are going to happen after 2.1.1, I didn't
feel like changing each and every font driver to support them
right now...
Of course, wathever changes will happen in the future
Please test them and report your feelings about it. I'd appreciate
if you could take a quick look at the sources to ensure that the
functions do what you really want them to do :-)
Thanks,
- David Turner
- The FreeType Project (www.freetype.org)
Juliusz Chroboczek a écrit :
>
> Hi,
>
> I sent this on Friday, but it doesn't seem to have hit the list.
> Sorry if you receive this twice.
>
> In the FreeType 2 backend for XFree86, I am using a number of internal
> interfaces. I would be very grateful if you could consider including
> them or interfaces with the same functionality in a future release of
> FreeType.
>
> A sample implementation (not one that I particularly recommend, and
> one that will most definitely not satisfy your high standards, but one
> that temporarily satisfies my needs) is available in
>
> http://www.pps.jussieu.fr/~jch/software/files/fthack.c
> http://www.pps.jussieu.fr/~jch/software/files/fthack.h
>
> Thanks a lot,
>
> Juliusz
>
> PS: Keith, if you need further extensions for Xft, speak now, or
> forever...
>
> ----------------------------------------------------------------------
> /* Returns true if the font prefers to be indexed by name. Currently
> returns true for Type 1 fonts, which is suboptimal in the presence
> of OpenType/CFF fonts converted from Type 1. But what else can be
> done? */
>
> int FT_Face_Prefers_Names(FT_Face face);
>
> /* Returns a human-readable name for the font technology used by the
> font. The name should be suitable for use as an X11 FONT_TYPE
> property. */
>
> char *FT_Face_Font_Type(FT_Face face);
>
> typedef enum {
> ft_type1_info = 0,
>
> type1_max
> } FT_Type1_Tag;
>
> /* Returns a table from a Type 1 font, NULL otherwise. */
>
> void *FT_Get_Type1_Table(FT_Face face, FT_Type1_Tag tag);
> ----------------------------------------------------------------------
>
> _______________________________________________
> Freetype mailing list
> address@hidden
> http://www.freetype.org/mailman/listinfo/freetype