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

How to add font with specific character set in openspades? #172

Closed
noway opened this issue Mar 8, 2014 · 14 comments
Closed

How to add font with specific character set in openspades? #172

noway opened this issue Mar 8, 2014 · 14 comments
Assignees

Comments

@noway
Copy link
Contributor

noway commented Mar 8, 2014

So, like japanese with font-mplus-ja.pak. Russian font looks terrible currently, so i want to add normal font package for it.

Or maybe you can specify fallback font?

shot0025

@yvt
Copy link
Owner

yvt commented Mar 8, 2014

Sources/Tools/BdfToOSFont.cpp

@noway
Copy link
Contributor Author

noway commented Mar 9, 2014

Thanks for the tool! It's not working for me, though.
It's generating this output http://pastebin.com/QNBdkidR and 1x1 .tga image.

This is my bdf font: https://gist.github.com/noway421/a5b914e32eb95a32e274

What i am doing wrong?

@yvt
Copy link
Owner

yvt commented Mar 9, 2014

Sorry but currently BdfToOSFont is designed to handle only certain BDF files due to its complexity (and complete lack of my knowledge about BDF format), so source code modification is required for almost every font to be converted.

You might be able to get it working easily if you could create something called "Unicode BDF".

@noway
Copy link
Contributor Author

noway commented Mar 9, 2014

This BDF font is in unicode already.
screenshot from 2014-03-09 14 23 08

I tried to generate font with '(Unicode, Full)' but its not working too.

@yvt
Copy link
Owner

yvt commented Mar 9, 2014

sed -e "s/STARTCHAR /STARTCHAR U+/g" < in.bdf > processed.bdf

@noway
Copy link
Contributor Author

noway commented Mar 9, 2014

It works! But in result file all characters vertically flipped. How to fix it?
screenshot from 2014-03-09 14 42 45

@yvt
Copy link
Owner

yvt commented Mar 9, 2014

No problem, it should works.

@noway
Copy link
Contributor Author

noway commented Mar 9, 2014

Looks like BbfToOSFont doesn't understand BBX field correctly.

STARTCHAR U+0434
ENCODING 1076
SWIDTH 500 0
DWIDTH 8 0
BBX 8 16 0 -2
BITMAP 
00
00
00
00
00
00
1E
12
22
22
42
42
42
7F
41
00
ENDCHAR
STARTCHAR U+0434
ENCODING 1076
SWIDTH 500 0
DWIDTH 8 0
BBX 7 9 1 -1
BITMAP
3C
24
44
44
84
84
84
FE
82
ENDCHAR

This is character ('д' in that example) declared in two different ways. In first it altered with empty pixels, in second BBX field is modified.
In second case BBX field processed not correctly by BbfToOSFont. Character becames incorrectly positioned.

Can you fix it? This two examples should give same result.

Sample files: https://gist.github.com/noway421/4ef1e383aef068939a8d
http://unifoundry.com/pub/unifont-6.3.20140214/font-builds/unifont-6.3.20140214.bdf.gz

@noway
Copy link
Contributor Author

noway commented Mar 9, 2014

To clear things out: this output produced by fontforge - popular font editor.
So it would be neat if this software would be supported.

@noway
Copy link
Contributor Author

noway commented Mar 11, 2014

Ehm, looks like it's not working. I compiled new BdfToOSFont and openspades from git, but results are same.
How it should be (generated from hand-written file):
screenshot from 2014-03-11 11 11 43

How it is (generated from font, that was rendered in fontforge):
screenshot from 2014-03-11 11 21 28

@noway
Copy link
Contributor Author

noway commented Mar 11, 2014

Also, hand-written font looks better after your fix (it is better aligned then before). So there is some progress.

@yvt yvt self-assigned this Mar 11, 2014
@yvt
Copy link
Owner

yvt commented Mar 11, 2014

BBX is now correctly processed

font-unifont.pak:
screen shot 2014-03-12 at 12 09 55 am

@noway
Copy link
Contributor Author

noway commented Mar 11, 2014

Now it works with fontforge fonts! Thanks!

@yvt yvt closed this as completed Mar 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants