aboutsummaryrefslogtreecommitdiffhomepage
path: root/libass
diff options
context:
space:
mode:
authorGravatar eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-22 19:31:51 +0000
committerGravatar eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-22 19:31:51 +0000
commitb803331d0c9ca82d1734fc97dfa74726566ac40f (patch)
treee26a571a6f00325991c25f00aac331ec2573dd53 /libass
parentdd8c7c9e2c54a2a70eb994eba76d324c2728db40 (diff)
Some debugging routines.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26066 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_utils.c26
-rw-r--r--libass/ass_utils.h1
2 files changed, 27 insertions, 0 deletions
diff --git a/libass/ass_utils.c b/libass/ass_utils.c
index 3be71b8f31..eaa3455f07 100644
--- a/libass/ass_utils.c
+++ b/libass/ass_utils.c
@@ -22,6 +22,8 @@
#include <stdlib.h>
#include <inttypes.h>
+#include <ft2build.h>
+#include FT_GLYPH_H
#include "mputils.h"
#include "ass_utils.h"
@@ -79,3 +81,27 @@ int strtocolor(char** q, uint32_t* res)
return result;
}
+static void sprint_tag(uint32_t tag, char* dst)
+{
+ dst[0] = (tag >> 24) & 0xFF;
+ dst[1] = (tag >> 16) & 0xFF;
+ dst[2] = (tag >> 8) & 0xFF;
+ dst[3] = tag & 0xFF;
+ dst[4] = 0;
+}
+
+void dump_glyph(FT_Glyph g)
+{
+ char tag[5];
+ int i;
+ FT_OutlineGlyph og = (FT_OutlineGlyph)g;
+ FT_Outline* o = &(og->outline);
+ sprint_tag(g->format, tag);
+ printf("glyph: %p \n", g);
+ printf("format: %s \n", tag);
+ printf("outline: %p \n", o);
+ printf("contours: %d, points: %d, points ptr: %p \n", o->n_contours, o->n_points, o->points);
+ for (i = 0; i < o->n_points; ++i) {
+ printf(" point %f, %f \n", d6_to_double(o->points[i].x), d6_to_double(o->points[i].y));
+ }
+}
diff --git a/libass/ass_utils.h b/libass/ass_utils.h
index f574409783..0d121a8a12 100644
--- a/libass/ass_utils.h
+++ b/libass/ass_utils.h
@@ -25,6 +25,7 @@ int mystrtoi(char** p, int base, int* res);
int mystrtou32(char** p, int base, uint32_t* res);
int mystrtod(char** p, double* res);
int strtocolor(char** q, uint32_t* res);
+void dump_glyph(FT_Glyph g);
static inline int d6_to_int(int x) {
return (x + 32) >> 6;