git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Slightly better kerning maybe?
[ipdf/code.git]
/
src
/
document.cpp
diff --git
a/src/document.cpp
b/src/document.cpp
index
35673d4
..
57b8925
100644
(file)
--- a/
src/document.cpp
+++ b/
src/document.cpp
@@
-615,6
+615,8
@@
pair<unsigned, unsigned> Document::ParseSVGPathData(const string & d, const SVGM
x[0] = (relative) ? x[0] + dx : dx;
y[0] = (relative) ? y[0] + dy : dy;
x[0] = (relative) ? x[0] + dx : dx;
y[0] = (relative) ? y[0] + dy : dy;
+ x0 = x[0];
+ y0 = y[0];
//Debug("mmoveto %f,%f", Float(x[0]),Float(y[0]));
command = (command == "m") ? "l" : "L";
}
//Debug("mmoveto %f,%f", Float(x[0]),Float(y[0]));
command = (command == "m") ? "l" : "L";
}
@@
-800,7
+802,8
@@
void Document::AddText(const string & text, Real scale, Real x, Real y)
{
kerning = stbtt_GetCodepointKernAdvance(&m_font, text[i-1], text[i]);
}
{
kerning = stbtt_GetCodepointKernAdvance(&m_font, text[i-1], text[i]);
}
- x += Real(font_scale) * Real(left_side_bearing + kerning);
+ Debug("%c: lsb %d, kern %d, adv_width %d", text[i], left_side_bearing, kerning, advance_width);
+ x += Real(font_scale) * Real(kerning);
AddFontGlyphAtPoint(&m_font, text[i], font_scale, x, y);
x += Real(font_scale) * Real(advance_width);
}
AddFontGlyphAtPoint(&m_font, text[i], font_scale, x, y);
x += Real(font_scale) * Real(advance_width);
}
UCC
git Repository :: git.ucc.asn.au