Commit feab1e98 authored by Adrian Johnson's avatar Adrian Johnson Committed by Carlos Garcia Campos

Add CairoOutputDev functions for getting Type 3 glyph metrics

parent a75efe20
......@@ -126,6 +126,7 @@ CairoOutputDev::CairoOutputDev() {
currentFont = NULL;
prescaleImages = gTrue;
printing = gTrue;
t3_glyph_has_bbox = gFalse;
groupColorSpaceStack = NULL;
group = NULL;
......@@ -675,10 +676,19 @@ void CairoOutputDev::endType3Char(GfxState *state) {
}
void CairoOutputDev::type3D0(GfxState *state, double wx, double wy) {
t3_glyph_wx = wx;
t3_glyph_wy = wy;
}
void CairoOutputDev::type3D1(GfxState *state, double wx, double wy,
double llx, double lly, double urx, double ury) {
t3_glyph_wx = wx;
t3_glyph_wy = wy;
t3_glyph_bbox[0] = llx;
t3_glyph_bbox[1] = lly;
t3_glyph_bbox[2] = urx;
t3_glyph_bbox[3] = ury;
t3_glyph_has_bbox = gTrue;
}
void CairoOutputDev::endTextObject(GfxState *state) {
......
......@@ -214,6 +214,10 @@ public:
void setCairo (cairo_t *cr);
void setPrinting (GBool printing) { this->printing = printing; }
void getType3GlyphWidth (double *wx, double *wy) { *wx = t3_glyph_wx; *wy = t3_glyph_wy; }
GBool hasType3GlyphBBox () { return t3_glyph_has_bbox; }
double *getType3GlyphBBox () { return t3_glyph_bbox; }
protected:
void doPath(cairo_t *cairo, GfxState *state, GfxPath *path);
......@@ -240,6 +244,9 @@ protected:
cairo_glyph_t *glyphs;
int glyphCount;
cairo_path_t *textClipPath;
double t3_glyph_wx, t3_glyph_wy;
GBool t3_glyph_has_bbox;
double t3_glyph_bbox[4];
GBool prescaleImages;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment