From c0c888f0b10296435e89467b7a4157d463c9ae5b Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Fri, 15 Jan 2010 19:34:43 -0800 Subject: [PATCH] added kerning support to record device --- lib/devices/record.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/devices/record.c b/lib/devices/record.c index 4cc75dd..cf04db6 100644 --- a/lib/devices/record.c +++ b/lib/devices/record.c @@ -257,6 +257,12 @@ static void dumpFont(writer_t*w, gfxfont_t*font) for(t=0;tmax_unicode;t++) { writer_writeU32(w, font->unicode2glyph[t]); } + writer_writeU32(w, font->kerning_size); + for(t=0;tkerning_size;t++) { + writer_writeU32(w, font->kerning[t].c1); + writer_writeU32(w, font->kerning[t].c2); + writer_writeU32(w, font->kerning[t].advance); + } } static gfxfont_t*readFont(reader_t*r) { @@ -282,6 +288,15 @@ static gfxfont_t*readFont(reader_t*r) for(t=0;tmax_unicode;t++) { font->unicode2glyph[t] = reader_readU32(r); } + font->kerning_size = reader_readU32(r); + if(font->kerning_size) { + font->kerning = malloc(sizeof(gfxkerning_t)*font->kerning_size); + for(t=0;tkerning_size;t++) { + font->kerning[t].c1 = reader_readU32(r); + font->kerning[t].c2 = reader_readU32(r); + font->kerning[t].advance = reader_readU32(r); + } + } return font; } -- 1.7.10.4