Re: [KanjiVG/kanjivg] Most (all?) kanji are off-center (#192)

60 views
Skip to first unread message

sjs

unread,
Apr 18, 2021, 12:37:40 PM4/18/21
to Alexandre Courbot, KanjiVG
On 4/17/21 6:37 PM, Alexandre Courbot wrote:
>
> Yeah, the canvas has an interesting size to say the least. Maybe it
> would be worth harmonizing all characters to something more intuitive,
> e.g. 100x100.
>
That sounds good but it's a rather significant change.  And do you plan
on changing the svg files too??  I'm guessing someone out there has
109x109 hard coded into their program... probably multiple someones :)

Does anyone know the history of the 109x109 size?

I just pulled the latest versions of kanjivg-20160426-all.zip and
kanjivg-20160426.xml,gz.

All the svg files have:
<svg xmlns="http://www.w3.org/2000/svg" width="109" height="109"
viewBox="0 0 109 109">

The xml namespace declaration is:
<kanjivg xmlns:kvg='http://kanjivg.tagaini.net'>
And I don't see the width/height/viewbox info anywhere in the file.

I believe the viewbox is used as a transform matrix and the width/height
are used to set the size of the image, right?  Would just adding the
viewbox info to the XML once at the top would fix the problem.  i.e.
Current xml:
<kanjivg xmlns:kvg='http://kanjivg.tagaini.net'>
<kanji id="kvg:kanji_00021">
<g id="kvg:00021">
...

Change:
<kanjivg xmlns:kvg='http://kanjivg.tagaini.net'>
<viewBox 0,0,109,109/>
<kanji id="kvg:kanji_00021">
<g id="kvg:00021">
...

Or:
<kanjivg xmlns:kvg='http://kanjivg.tagaini.net'>
<kanji id="kvg:kanji_00021" viewBox="0 0 109 109">
<g id="kvg:00021">
...

The second is the one I would prefer because it would allow you to
change things to a character level later if you should want to.

I put a version of kanjivg-20160426.xml,gz. on my page at
http://sonic.net/~sjs/kanjivg.xml.gz if there's interest in this.

Steve S.


Reply all
Reply to author
Forward
0 new messages