summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e614b42)
raw | patch | inline | side by side (parent: e614b42)
author | scislac <scislac@users.sourceforge.net> | |
Fri, 25 Sep 2009 21:48:48 +0000 (21:48 +0000) | ||
committer | scislac <scislac@users.sourceforge.net> | |
Fri, 25 Sep 2009 21:48:48 +0000 (21:48 +0000) |
src/libnrtype/Layout-TNG-Output.cpp | patch | blob | history |
index 2003ca26bbc89bd1a3635049de7635c64dd22cc3..2b4b80e7c4cfc01f5f30b0d72997c956a7100016 100644 (file)
void Layout::showGlyphs(CairoRenderContext *ctx) const
{
if (_input_stream.empty()) return;
-
+
bool clip_mode = false;//(ctx->getRenderMode() == CairoRenderContext::RENDER_MODE_CLIP);
std::vector<CairoGlyphInfo> glyphtext;
continue;
}
- Geom::Matrix font_matrix;
- if (_path_fitted == NULL) {
- font_matrix = glyph_matrix;
- font_matrix[4] = 0;
- font_matrix[5] = 0;
- } else {
- font_matrix.setIdentity();
- }
+ Geom::Matrix font_matrix = glyph_matrix;
+ font_matrix[4] = 0;
+ font_matrix[5] = 0;
Glib::ustring::const_iterator span_iter = span.input_stream_first_character;
unsigned char_index = _glyphs[glyph_index].in_character;
CairoGlyphInfo info;
info.index = _glyphs[glyph_index].glyph;
- if (_path_fitted == NULL) {
- info.x = glyph_matrix[4];
- info.y = glyph_matrix[5];
- } else {
- info.x = 0;
- info.y = 0;
- }
+ // this is the translation for x,y-offset
+ info.x = glyph_matrix[4];
+ info.y = glyph_matrix[5];
+
glyphtext.push_back(info);
glyph_index++;
&& _path_fitted == NULL
&& NR::transform_equalp(font_matrix, glyph_matrix, NR_EPSILON)
&& _characters[_glyphs[glyph_index].in_character].in_span == this_span_index);
-
+
// remove vertical flip
- font_matrix[3] *= -1.0;
+ Geom::Matrix flip_matrix;
+ flip_matrix.setIdentity();
+ flip_matrix[3] = -1.0;
+ font_matrix = flip_matrix * font_matrix;
SPStyle const *style = text_source->style;
float opacity = SP_SCALE24_TO_FLOAT(style->opacity.value);
-
- if (_path_fitted) {
- ctx->pushState();
- ctx->transform(&glyph_matrix);
- } else if (opacity != 1.0) {
+
+ if (opacity != 1.0) {
ctx->pushState();
ctx->setStateForStyle(style);
ctx->pushLayer();
}
if (glyph_index - first_index > 0)
ctx->renderGlyphtext(span.font->pFont, &font_matrix, glyphtext, style);
- if (_path_fitted)
- ctx->popState();
- else if (opacity != 1.0) {
+ if (opacity != 1.0) {
ctx->popLayer();
ctx->popState();
}