Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow usage specify unicode code for each character #53

Closed
edouard-lopez opened this issue Mar 27, 2017 · 13 comments
Closed

Allow usage specify unicode code for each character #53

edouard-lopez opened this issue Mar 27, 2017 · 13 comments

Comments

@edouard-lopez
Copy link

edouard-lopez commented Mar 27, 2017

I'm building a font from SVG files. For instance:

中.svg
山.svg
火.svg
西.svg
…

However 中 is associate with U+EA02 instead of U+4E2D CJK UNIFIED IDEOGRAPH-4E2D.

Question

Is there a convention I'm missing to assign a glyph to the correct codepoint?

related: parlr/Hanzi-Pinyin-Font#22 - Associate glyph with correct codepoint.

@alexander-akait
Copy link
Member

@edouard-lopez thanks for feedback, i don't know why it is happens, need investigation, if you have time feel free to PR or create issue to related project 👍

@edouard-lopez
Copy link
Author

@evilebottnawi I used neither startunicode nor prependUnicode argument and name the SVG file with the character (not it's codepoint).

@alexander-akait
Copy link
Member

@edouard-lopez can you upload here one of svg?

@edouard-lopez
Copy link
Author

Here is 中.svg and the script to build those files.

@alexander-akait
Copy link
Member

@edouard-lopez oh sorry, I did not immediately understand what you specifically mean 😄 Filename of svg files not associated with real unicode characters (). Starting unicode https://github.com/nfroidure/svgicons2svgfont/blob/master/src/metadata.js#L17 Why you need associated real filename and unicode?

@edouard-lopez
Copy link
Author

I generate the file from Unicode database, should I use the codepoint (e.g. U+3400)?

@alexander-akait
Copy link
Member

@edouard-lopez we can generate custom font and use the offset to not intersect with the real characters of the fonts. This approach is used by all font generators, if you can explain in more detail why you need it and for what, then maybe I can help

@edouard-lopez
Copy link
Author

@evilebottnawi my goal is to generate a Chinese font based on Noto CJK (Chinese/Japenese/Korean) to add the pronunciation on top of each Chinese character, see repo, like example below.

annotation-top

But the generated glyph should have the same codepoint as the original one otherwise it will be pointless as users won't be able to type the character.

@alexander-akait
Copy link
Member

@edouard-lopez Thanks for the explanation, I think it's workable, I'll try to find a solution this week, but you can try it yourself and send PR 👍

@alexander-akait alexander-akait changed the title How can I choose the codepoint of a glyph Allow usage specify unicode character for each character Mar 28, 2017
@alexander-akait alexander-akait changed the title Allow usage specify unicode character for each character Allow usage specify unicode code for each character Mar 28, 2017
@edouard-lopez
Copy link
Author

I would expect an option --detect-codepoint based on the filename: either U+3400.svg or 㐀.svg.

What do you think?

@alexander-akait
Copy link
Member

@edouard-lopez sgtm for me!

@edouard-lopez
Copy link
Author

edouard-lopez commented Apr 3, 2017

@evilebottnawi svgicons2svgfont already support what I wanted through a naming convention:

${unicode}-${char.glyph}.svg

For example:

└── svg
    ├── u3400-㐀.svg
    ├── u3401-㐁.svg
    ├── u3404-㐄.svg
    ├── u3405-㐅.svg
    ├── u3406-㐆.svg

@alexander-akait
Copy link
Member

@edouard-lopez it is good 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants