#10508 closed defect (fixed)
Fix for font hex conversion in dojox.gfx.VectorText.js _decodeEntitySequence()
Reported by: | mwarren | Owned by: | Tom Trenka |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | DojoX GFX | Version: | 1.4.0 |
Keywords: | vector font VectorText.js | Cc: | Tom Trenka |
Blocked By: | Blocking: |
Description
SVG fonts with character that use a hex unicode name such as &x#ab; are not correctly decoded by dojo.gfx.VectorFont?._decodeEntitySequence(). Line 74 in revision 15318 of VectorText?.js (http://trac.dojotoolkit.org/browser/dojox/trunk/gfx/VectorText.js?rev=15318 ) can be changed like this to resolve the problem:
$ diff VectorText.js-15318 VectorText.js 74c74 < tmp+=String.fromCharCode( r[1].slice(2),16); --- > tmp+=String.fromCharCode("0x"+r[1].slice(2));
Change History (6)
comment:1 Changed 11 years ago by
Owner: | changed from Eugene Lazutkin to Tom Trenka |
---|
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
This perl commandline will convert hex unicode attributes into decimal attributes
perl -pe 'if (m/unicode=\"&#(x[\da-f]+);/i){ $uni = "0".$1; $_ =~ s/$1/sprintf("%d",eval($uni))/e;}' MyOriginalFont-hex.svg > MyNewFont-decimal.svg
comment:4 Changed 11 years ago by
Milestone: | tbd → 1.5 |
---|
comment:5 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:6 Changed 11 years ago by
(In [21655]) Make sure we catch the undefined if an entity is not in the XmlEntityMap?. Refs #10508 !strict.
Note: See
TracTickets for help on using
tickets.
One workaround for this problem is changing the
glyph
unicode
attributes within the SVG font file to use decimal encoding instead of hex. For example, the SVGglyph
attributeunicode=""
can be changed tounicode=""
to workaround this issue.