Subject: | Please add new functions to library (encoding and charmaps size, FT_Get_Sfnt_Name API wrappers) |
Date: | Sun, 16 Oct 2016 23:52:10 +0200 |
To: | bug-font-freetype [...] rt.cpan.org |
From: | Florian Schlichting <fsfs [...] debian.org> |
We have the following bug reported to the Debian package of
Font-FreeType (https://bugs.debian.org/503937):
It has been sitting in the Debian bug tracker for an awfully long time
without reply, and as I don't feel qualified to judge the merits of the
suggested patch either (it only adds new functions, so can't hurt, no?)
I was hoping you could take a look. Thanks!
------8<-----------8<-----------8<-----------8<-----------8<-----
Package: libfont-freetype-perl
Version: 0.03-1
Severity: wishlist
Tags: patch
Hi, maintainer.
Defoma-hints of defoma doesn't work now.
The reason is that perlftlib that was a library need to move defoma-hints
was removed from Debian.
I fixed the library of defomat to use libfont-freetype-perl as taking the
place of perlftlib.
However, because the function of some Freetype is not implemented, it has not worked yet.
This patch is used to implement an insufficient function.
Those functions are functions to get the encoding of Font and FT_Get_Sfnt_Name, FT_Get_Sfnt_Name_Count.
Please cehck and apply this patch.
And I don"t know Perl so much. Please point it out if wrong.
Best regards,
Nobuhiro
--Multipart=_Wed__29_Oct_2008_22_12_06_+0900_6CC4gVau9ELsNZIn
Content-Type: application/octet-stream;
name="99_add_new_func.dpatch"
Show quoted text
>#! /bin/sh /usr/share/dpatch/dpatch-run
>## 90-add-new-func.dpatch by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
>##
>## 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<undef>
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<idx>, I<platform>, I<encoding>, I<language>, I<name>)
+
+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<width>, I<height>, I<x_res>, I<y_res>)
Set the size at which glyphs should be rendered. Metrics are also
------8<-----------8<-----------8<-----------8<-----------8<-----
Thanks for considering,
Florian Schlichting,
Debian Perl Group