dest->num_points = count;
dest->points = rfx_calloc(count*sizeof(ttfpoint_t));
count = 0;
+ line = src->line;
while(line) {
if(line->type == gfx_splineTo) {
dest->points[count].x = line->sx*scale;
count++;
line=line->next;
}
+ if(count)
+ dest->points[count-1].flags |= GLYPH_CONTOUR_END;
/* compute bounding box */
int s;
dest->ymin = dest->ymax = dest->points[0].y;
for(s=1;s<count;s++) {
if(dest->points[s].x < dest->xmin)
- dest->xmin = dest->points[0].x;
- if(dest->points[s].y < dest->xmin)
- dest->xmin = dest->points[0].y;
- if(dest->points[s].x > dest->xmin)
- dest->xmax = dest->points[0].x;
- if(dest->points[s].y > dest->xmin)
- dest->ymax = dest->points[0].y;
+ dest->xmin = dest->points[s].x;
+ if(dest->points[s].y < dest->ymin)
+ dest->ymin = dest->points[s].y;
+ if(dest->points[s].x > dest->xmax)
+ dest->xmax = dest->points[s].x;
+ if(dest->points[s].y > dest->ymax)
+ dest->ymax = dest->points[s].y;
}
}
}
ttf->unicode_size = max_unicode+1;
ttf->unicode = rfx_calloc(sizeof(unicode_t)*ttf->unicode_size);
- for(t=0;t<ttf->num_glyphs;t++) {
+ for(t=0;t<font->num_glyphs;t++) {
gfxglyph_t*src = &font->glyphs[t];
int u = font->glyphs[t].unicode;
if(u>=0)
}
int u;
for(u=0;u<font->max_unicode;u++) {
- int g = font->unicode2glyph[t];
+ int g = font->unicode2glyph[u];
if(g>=0) {
- ttf->unicode[u] = g;
+ ttf->unicode[u] = g+offset;
}
}
ttf->ascent = font->ascent;
head->xmax = ttf->glyphs[0].xmax;
head->ymax = ttf->glyphs[0].ymax;
for(t=1;t<ttf->num_glyphs;t++) {
- if(ttf->glyphs[0].xmin < head->xmin) head->xmin = ttf->glyphs[0].xmin;
- if(ttf->glyphs[0].ymin < head->ymin) head->ymin = ttf->glyphs[0].ymin;
- if(ttf->glyphs[0].xmax > head->xmax) head->xmax = ttf->glyphs[0].xmax;
- if(ttf->glyphs[0].ymax > head->ymax) head->ymax = ttf->glyphs[0].ymax;
+ if(ttf->glyphs[t].xmin < head->xmin) head->xmin = ttf->glyphs[t].xmin;
+ if(ttf->glyphs[t].ymin < head->ymin) head->ymin = ttf->glyphs[t].ymin;
+ if(ttf->glyphs[t].xmax > head->xmax) head->xmax = ttf->glyphs[t].xmax;
+ if(ttf->glyphs[t].ymax > head->ymax) head->ymax = ttf->glyphs[t].ymax;
}
}
head->macStyle = 0;
for(t=0;t<ttf->num_glyphs;t++) {
if(ttf->glyphs[t].advance > hea->advanceWidthMax)
hea->advanceWidthMax = ttf->glyphs[t].advance;
- if(ttf->glyphs[t].xmin < ttf->hea->minLeftSideBearing)
- ttf->hea->minLeftSideBearing = ttf->glyphs[t].xmin;
- if(ttf->glyphs[t].xmax < ttf->hea->minRightSideBearing)
- ttf->hea->minRightSideBearing = ttf->glyphs[t].xmax;
+ if(ttf->glyphs[t].xmin < hea->minLeftSideBearing)
+ hea->minLeftSideBearing = ttf->glyphs[t].xmin;
+ if(ttf->glyphs[t].xmax < hea->minRightSideBearing)
+ hea->minRightSideBearing = ttf->glyphs[t].xmax;
int width = ttf->glyphs[t].xmax - ttf->glyphs[t].xmin;
if(width > hea->xMaxExtent)
hea->xMaxExtent = width;
../lib/libgfxpdf$(A): ../lib/pdf/GFXOutputDev.cc
cd ../lib;$(MAKE) libgfxpdf$(A);cd -
-../lib/libgfx$(A): ../lib/devices/*.c
+../lib/libgfx$(A): ../lib/devices/*.c ../lib/gfxdevice.h ../lib/gfxtools.c ../lib/gfxfont.c
cd ../lib;$(MAKE) libgfx$(A);cd -
../lib/libgfxswf$(A): ../lib/devices/swf.c