summaryrefslogtreecommitdiff
path: root/lib/devices
diff options
context:
space:
mode:
authorMatthias Kramm <kramm@quiss.org>2010-01-15 19:34:43 -0800
committerMatthias Kramm <kramm@quiss.org>2010-01-15 19:34:43 -0800
commitc0c888f0b10296435e89467b7a4157d463c9ae5b (patch)
tree70620ec39513efdcf9e1b8ece2f339c5e3f4e8fc /lib/devices
parent2ddfa640af28b592ecf4295f0b1b7b43c923f707 (diff)
added kerning support to record device
Diffstat (limited to 'lib/devices')
-rw-r--r--lib/devices/record.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/devices/record.c b/lib/devices/record.c
index 4cc75dde..cf04db6a 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;t<font->max_unicode;t++) {
writer_writeU32(w, font->unicode2glyph[t]);
}
+ writer_writeU32(w, font->kerning_size);
+ for(t=0;t<font->kerning_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;t<font->max_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;t<font->kerning_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;
}