#! /bin/sh /usr/share/dpatch/dpatch-run ## 90-add-new-func.dpatch by Nobuhiro Iwamatsu ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Add ## - get encoding and charmaps size function ## - FT_Get_Sfnt_Name API wrappers @DPATCH@ diff -urNad libfont-freetype-perl-0.03~/FreeType.xs libfont-freetype-perl-0.03/FreeType.xs --- libfont-freetype-perl-0.03~/FreeType.xs 2008-10-29 21:59:07.000000000 +0900 +++ libfont-freetype-perl-0.03/FreeType.xs 2008-10-29 22:00:12.000000000 +0900 @@ -432,7 +432,6 @@ OUTPUT: RETVAL - SV * qefft2_face_postscript_name (Font_FreeType_Face face) PREINIT: @@ -446,6 +445,52 @@ OUTPUT: RETVAL +long +qefft2_face_get_sfnt_name (face, idx, plat, enc, lang, name) + Font_FreeType_Face face + long idx + short &plat = NO_INIT + short &enc = NO_INIT + short &lang = NO_INIT + short &name = NO_INIT + PREINIT: + FT_SfntName sfnt; + CODE: + RETVAL = FT_Get_Sfnt_Name(face, idx, &sfnt); + plat = sfnt.platform_id; + enc = sfnt.encoding_id; + lang = sfnt.language_id; + name = sfnt.name_id; + OUTPUT: + RETVAL + plat + enc + lang + name + +unsigned int +qefft2_face_get_sfnt_name_cnt (Font_FreeType_Face face) + CODE: + RETVAL = FT_Get_Sfnt_Name_Count(face); + OUTPUT: + RETVAL + +int +qefft2_face_num_charmaps (Font_FreeType_Face face) + CODE: + RETVAL = face->num_charmaps; + OUTPUT: + RETVAL + +long +qefft2_face_encoding (Font_FreeType_Face face, int idx) + CODE: + if (face->num_charmaps < 0) + RETVAL = -1; + else + RETVAL = face->charmaps[idx]->encoding; + OUTPUT: + RETVAL const char * qefft2_face_family_name (Font_FreeType_Face face) diff -urNad libfont-freetype-perl-0.03~/lib/Font/FreeType/Face.pm libfont-freetype-perl-0.03/lib/Font/FreeType/Face.pm --- libfont-freetype-perl-0.03~/lib/Font/FreeType/Face.pm 2004-09-12 04:39:37.000000000 +0900 +++ libfont-freetype-perl-0.03/lib/Font/FreeType/Face.pm 2008-10-29 21:59:07.000000000 +0900 @@ -240,6 +240,24 @@ A string containing the PostScript name of the font, or I if it doesn't have one. +=item get_sfnt_name_cnt() + +Retrieve the number of name strings in the SFNT `name' table. +The number of strings in the `name' table. + +=item get_sfnt_name(I, I, I, I, I) + +Retrieve a string of the SFNT `name' table for a given index. +Get platform, encoding, language, name Font data from index. + +=item num_charmaps() + +Get font charmap number. + +=item encoding() + +Get font encoding. + =item set_char_size(I, I, I, I) Set the size at which glyphs should be rendered. Metrics are also