Font::Font(const GfxState *state, double size) { if ( size<1 ) kdDebug(30516) << "very small font size=" << size << endl; _pointSize = qRound(size); GfxRGB rgb; state->getFillRGB(&rgb); _color = toColor(rgb); GfxFont *font = state->getFont(); GString *gname = (font ? font->getName() : 0); QString name = (gname ? gname->getCString() : 0); // kdDebug(30516) << "font: " << name << endl; name = name.section('+', 1, 1).lower(); if ( name.isEmpty() ) name = "##dummy"; // dummy name init(name); }
void PreScanOutputDev::beginStringOp(GfxState *state) { int render; GfxFont *font; double m11, m12, m21, m22; Ref embRef; DisplayFontParam *dfp; GBool simpleTTF; render = state->getRender(); if (!(render & 1)) { check(state->getFillColorSpace(), state->getFillColor(), state->getFillOpacity(), state->getBlendMode()); } if ((render & 3) == 1 || (render & 3) == 2) { check(state->getStrokeColorSpace(), state->getStrokeColor(), state->getStrokeOpacity(), state->getBlendMode()); } font = state->getFont(); state->getFontTransMat(&m11, &m12, &m21, &m22); simpleTTF = fabs(m11 + m22) < 0.01 && m11 > 0 && fabs(m12) < 0.01 && fabs(m21) < 0.01 && fabs(state->getHorizScaling() - 1) < 0.001 && (font->getType() == fontTrueType || font->getType() == fontTrueTypeOT) && (font->getEmbeddedFontID(&embRef) || font->getExtFontFile() || (font->getName() && (dfp = globalParams->getDisplayFont(font)) && dfp->kind == displayFontTT)); if (simpleTTF) { //~ need to create a FoFiTrueType object, and check for a Unicode cmap } if (state->getRender() != 0 || !simpleTTF) { gdi = gFalse; } }