Fix a problem with combining character when they are used as accents (e.g., \vec)

This commit is contained in:
Davide P. Cervone 2011-11-05 15:23:41 -04:00
parent 4f14fbb301
commit 5394ea5b68
2 changed files with 8 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -1166,8 +1166,13 @@
var values = this.getValues("largeop","displaystyle"); var values = this.getValues("largeop","displaystyle");
if (values.largeop) if (values.largeop)
{variant = SVG.FONTDATA.VARIANT[values.displaystyle ? "-largeOp" : "-smallOp"]} {variant = SVG.FONTDATA.VARIANT[values.displaystyle ? "-largeOp" : "-smallOp"]}
for (var i = 0, m = this.data.length; i < m; i++) for (var i = 0, m = this.data.length; i < m; i++) {
{if (this.data[i]) {svg.Add(this.data[i].toSVG(variant,scale),svg.w,0,true)}} if (this.data[i]) {
var text = this.data[i].toSVG(variant,scale), x = svg.w;
if (x === 0 && -text.l > 10*text.w) {x += -text.l} // initial combining character doesn't combine
svg.Add(text,x,0,true);
}
}
svg.Clean(); svg.Clean();
if (this.data.join("").length !== 1) {delete svg.skew} if (this.data.join("").length !== 1) {delete svg.skew}
if (values.largeop) { if (values.largeop) {