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

add tiff loader to tipam [ex Document font-creation] #11

Closed
dwarcher opened this issue Oct 18, 2012 · 7 comments
Closed

add tiff loader to tipam [ex Document font-creation] #11

dwarcher opened this issue Oct 18, 2012 · 7 comments
Assignees

Comments

@dwarcher
Copy link

I have some TTFs that I'd like to use as fonts - what's the best way to turn them into PNG's that are usable as fonts? I was looking at the code and it looks like you are encoding the height and width so I'm guessing these aren't standard PNG's.

@rec
Copy link
Collaborator

rec commented Dec 19, 2012

This still isn't finalized but will be part of the manual.

@dwarcher
Copy link
Author

I ended up writing code to do this (and some other 2d render to texture code) if you are interested, I'll put it up on github.

@paddywwoof
Copy link
Collaborator

Yes. Certainly interested. Is it python code that should be part of the pi3d library? Do you have access rights to contribute to this github?

@dwarcher
Copy link
Author

Yeah, it could be incorporated into the library. I committed my code up at https://github.com/dwarcher/pi3d/tree/RenderToTexture

Unfortunately a lot of this work was done on an older version of pi3d so some merging needs to be done. The ttf loader may not be working 100% right now, but there are some other useful things like some drawing functions for drawing fonts and textures into another texture (useful if you are trying to do dynamic textures, texture animations, HUD's, etc).

@ghost ghost assigned paddywwoof Jan 3, 2013
@paddywwoof
Copy link
Collaborator

put dwarcher's tiff loader into tipam

@paddywwoof
Copy link
Collaborator

The Ttffont class is now implemented. Seems generally a better system which should be the default. Apart from integrating it with the new texture system there were 3 tweaks (if you want to fix this in the old version of pi3d though I would recommend upgrading at this stage): making the start point at the bottom left (as opposed to top left) of each character, adding a small gap to cope with overlapping italics (not sure why this happens, poss bug in ImageFont module) and adding the draw colour to ImageDraw.text()

Also fixed 'if ch > 0:' in String that scrambled text when ch == 0, i.e. a space!

@dwarcher
Copy link
Author

dwarcher commented Jan 7, 2013

Cool, thanks for the bugfixes!

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

3 participants