Fonts

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
MagicianFB
Posts: 11
Joined: Mon Oct 10, 2005 8:45 am

Fonts

Post by MagicianFB »

When I try to load a font and print it, it doesn't seem to work. Can anyone tell me what's wrong?

These are my codes:

Code: Select all

white = Color.new(255, 255, 255)

t = Font.load("times.ttf")

screen:fontPrint(t, 10, 10, "hello", white)

screen:flip()

repeat
	pad = Controls.read()
until pad:cross()
or

Code: Select all

white = Color.new(255, 255, 255)

t = Font.load("times.ttf")

t:setPixelSize(0, 12)

screen:fontPrint(t, 10, 10, "hello", white)

screen:flip()

repeat
	pad = Controls.read()
until pad:cross()
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Re: Fonts

Post by Shine »

Setting the pixel size is a good idea, but it is called like in Freetype, setPixelSizes and like in all other true type font output functions, like in Java AWT, Windows GDI etc., the y-coordinate specifies the base line of the output.

BTW: times.ttf sounds not like a free font. A warning: Don't distribute copyrighted fonts in your games and programs, like standard Windows system fonts, without the permission of the copyright holder!
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

where to get em

Post by the underminer »

A good free ttf font site can be found here:
http://www.webpagepublicity.com/free-fo ... #FreeFonts
If it says that the service is unaivalable, try again later. I'm not a font expert, so if someone finds something remotely normal like arial or tahoma, post here
Behold! The Underminer got hold of a PSP
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Re: where to get em

Post by Shine »

the underminer wrote:A good free ttf font site can be found here:
http://www.webpagepublicity.com/free-fo ... #FreeFonts
If it says that the service is unaivalable, try again later. I'm not a font expert, so if someone finds something remotely normal like arial or tahoma, post here
I'm not sure if the fonts are really free. The webpage says, that you can download the fonts and install it in your Windows system, but it doesn't say that you can distribute the fonts with your own programs. And e.g. I've downloaded "Lapland Bold" and the copyright information within the font says "Copyright (c)1992-1994 Weatherly Systems, In.c All Rights Reserved. Redistribution is stricly prohibited". So unless the author of the webpage has the permission from all the copyright holders of the fonts, it would be problematic to use the fonts.

But if you don't need special fonts, just use the built-in font in Lua Player. It is a "normal" font: a sans-serif font like Arial and the same typeface with fixed font characters.
User avatar
JoshDB
Posts: 87
Joined: Wed Oct 05, 2005 3:54 am

Post by JoshDB »

1001freefonts.com

They told me that I could distribute their fonts with freeware games. Most free font sites will allow that to be the case as long as the program is freeware.
netjunki
Posts: 1
Joined: Sat Dec 10, 2005 2:50 am

Truly Free Fonts

Post by netjunki »

I've recently been dealing with font licensing for work.

DejaVu is a nice font that is distributed under a BSD style license. It can be downloaded here:
http://dejavu.sourceforge.net/wiki/index.php/Main_Page
There is a link here to other Bitstream Vera Derivatives, but most of them have been merged with DejaVu.

Hope that helps.

-netjunki
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Re: Truly Free Fonts

Post by Shine »

netjunki wrote: There is a link here to other Bitstream Vera Derivatives, but most of them have been merged with DejaVu.
Thanks. In Lua Player Bitstream Vera itself is integrated, but only the sans-serif proportional and mono-spaced, because serif doesn't look very good on computer screens.
Zenurb
Posts: 106
Joined: Fri Sep 30, 2005 8:33 am
Location: United Kingdom
Contact:

Re: Truly Free Fonts

Post by Zenurb »

Shine wrote:
netjunki wrote: There is a link here to other Bitstream Vera Derivatives, but most of them have been merged with DejaVu.
Thanks. In Lua Player Bitstream Vera itself is integrated, but only the sans-serif proportional and mono-spaced, because serif doesn't look very good on computer screens.
Georgia is my favourite font.
Proud Dvorak User
US 1.5 PSP (Original)
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

Is there a way to display accents without switching to TTF?
I just started to work on a dictionary-like thing and would need to print
áéíóúöäü, etc
- by using the standard fontset, or
- by some fast way of re-displaying text with ttf,
- or..?
Post Reply