summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authorJosh Andler <scislac@gmail.com>2009-09-25 21:48:48 +0000
committerscislac <scislac@users.sourceforge.net>2009-09-25 21:48:48 +0000
commit985bfc17d854636e6b55167cd0de5b351af54342 (patch)
tree67b25da6930933c7153a1b5701a8554c6e9f5de4 /src/libnrtype
parentAdding PNG for SK tracing tutorial (LP 409230) (diff)
downloadinkscape-985bfc17d854636e6b55167cd0de5b351af54342.tar.gz
inkscape-985bfc17d854636e6b55167cd0de5b351af54342.zip
Patch by Adib for 248721. Thanks Adib!
(bzr r8650)
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/Layout-TNG-Output.cpp42
1 files changed, 16 insertions, 26 deletions
diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp
index 2003ca26b..2b4b80e7c 100644
--- a/src/libnrtype/Layout-TNG-Output.cpp
+++ b/src/libnrtype/Layout-TNG-Output.cpp
@@ -215,7 +215,7 @@ void Layout::print(SPPrintContext *ctx,
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;
@@ -243,14 +243,9 @@ void Layout::showGlyphs(CairoRenderContext *ctx) const
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;
@@ -276,13 +271,10 @@ void Layout::showGlyphs(CairoRenderContext *ctx) const
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++;
@@ -291,26 +283,24 @@ void Layout::showGlyphs(CairoRenderContext *ctx) const
&& _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();
}