--- In l..., "Kevin Townsend" wrote: >
> > I used a program from called BMFont from Angelcode.com
> >
> > http://www.angelcode.com/products/bmfont/
>
> I hadn't come across that before. It will be a bit of work to convert
the results to something usable, but it looks interesting since I often want to
export non-Latin unicode characters. Thanks for the link.
>
> How are you going about converting from the txt/targa file to something usable
by an MCU yourself?
>
> Kevin
>
Hi Kevin,
I took the bitmap file generated and loaded it into GIMP and then used the save
as C Header/source file option to export the data for use in my application.
I hadn't come across that before. It will be a bit of work to convert
the results to something usable, but it looks interesting since I often
want to export non-Latin unicode characters. Thanks for the link.
How are you going about converting from the txt/targa file to something
usable by an MCU yourself?
I hadn't come across that before. It will be a bit of work to convert the
results to something usable, but it looks interesting since I often want to
export non-Latin unicode characters. Thanks for the link.
How are you going about converting from the txt/targa file to something usable
by an MCU yourself?
Kevin
Reply by PeterElliot●June 16, 20092009-06-16
Hi Wouter,
I used a program from called BMFont from Angelcode.com
This generates a packed bitmap with x,y,w,h coordinates to extract each
character. The fonts have adjustable anti-aliasing etc.
There's also some sample code for handling the bitmaps, but I wrote my
own.
PJE
--- In l..., Wouter van Ooijen wrote: >
> I am working on a tool for writing RAM applications. I want to give the
> users an easy way to include a font (for use on a graphic LCD). So far I
> have managed to process TrueType and OpenType fonts (using Python/PIL)
> but the result is often not pleasant at smaller sizes.
>
> Are there any standard file formats for bitmapped fonst that I should
> consider?
>
> --
>
> Wouter van Ooijen
>
> -- -------
> Van Ooijen Technische Informatica: www.voti.nl
> consultancy, development, PICmicro products
> docent Hogeschool van Utrecht: www.voti.nl/hvu
>
Reply by cfbsoftware1●June 16, 20092009-06-16
--- In l..., Wouter van Ooijen wrote: >
> Note that I am not looking for fonts (unless they are really free beer),
> rather I am looking for an appropriate format that the user of my tool
> can use to supply a font.
>
A very simple technique you could use is to just to get the user to create a
monochrome BMP file containing one example of each character. This can be done
using the text insertion tool of a typical 'Paint' program. Just type
in each character in the desire font in the correct ASCII sequence on one line
and resize the canvas so that e.g. it is one character high by 95 characters
(the number of printable characters in the 128-char set) wide.
Reply by Wouter van Ooijen●June 16, 20092009-06-16
> I can send you the application, but as others
mentioned, there are legal
> issues.
I think what you wrote is compareable to what I have now, but I'll
consider the write-n-times trick.
--
Wouter van Ooijen
-- -------
Van Ooijen Technische Informatica: www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: www.voti.nl/hvu
Reply by "M. Manca"●June 16, 20092009-06-16
Wouter van Ooijen ha scritto: >> Some years ago I wrote a simple tool to convert ttf
fonts to an
>> array of bmps using Borland C++ builder 6. Simply write a char on a
>> canvas then read the canvas at pixel level, it is not so hard.
>
> That is exactly what I do, but using Python/PIL instead of BC++. But
> the problem is that those nice fonts do not render well to small
> sizes, so in addition to the above method I need a method to handle
> smaller fonts.
the problem is if you may use anti aliasing or not. I used the same
application to convert fonts for a graphic lcd display and they look
good, and for a thermal printer and they look not so good just because
printer can't manage anti aliasing.
So, if your display may manage gray levels you may use anti aliasing and
then if font doesn't look good as in a PC screen is a problem of your
application. Try to see how looks on a PC at same size, the font has to
look the same on both displays (it has always the same size in pixel so
it looks the same). >
> --
>
> Wouter van Ooijen
>
> -- ------- Van Ooijen Technische
> Informatica: www.voti.nl consultancy, development, PICmicro products
> docent Hogeschool van Utrecht: www.voti.nl/hvu
>
>
Reply by Jan Vanek●June 16, 20092009-06-16
Hi Wouter,
I wrote a small app which generates "bitmaps" for a font of a given size and
possibly with limited set of characters (e.g. only numbers). The result is
an include file and a define like Tahoma16. There is however no support for
antialiasing (1bit per pixel currently). It is a Win32 application and I use
flag NONANTIALIASED_QUALITY in the CreateFontIndirect() function. Without
this flag the application would recognize any "shadow" resulting from
windows-antialiasing as a pixel and the font looks bad. Maybe this is
possible to set in Python? Another tip to make the appearance nicer without
antialiasing is to use "shadow", i.e. you write the same text offset by x=1,
y=1, or even 8 times at all surrounding positions, and then the text itself.
The format to store the data is following:
#pragma once
#include "shared/base/Types.h"
template
struct FontCharT
{
u8 width; // width of the character
u8 top; // first non-empty line
u8 height; // count of lines
u8 _reserved;
u16 mask[N]; // sequence of bits
};
typedef FontCharT<1> FontChar;
template
struct FontDataT
{
u8 first; // first character
u8 count; // count of characters
u8 height; // height of the font
u8 _reserved;
const FontChar* chars[N];
};
typedef FontDataT<1> FontData;
I hope this is self describing. The generated file looks like:
typedef FontDataT<10> Tahoma22FontType;
extern const Tahoma22FontType Tahoma22FontData;
I can send you the application, but as others mentioned, there are legal
issues.
With regards,
Jan
----- Original Message -----
From: "Wouter van Ooijen"
To:
Sent: Tuesday, June 16, 2009 9:05 AM
Subject: [lpc2000] fonts for embedded systems >I am working on a tool for writing RAM applications. I
want to give the
> users an easy way to include a font (for use on a graphic LCD). So far I
> have managed to process TrueType and OpenType fonts (using Python/PIL)
> but the result is often not pleasant at smaller sizes.
>
> Are there any standard file formats for bitmapped fonst that I should
> consider?
>
> --
>
> Wouter van Ooijen
>
> -- -------
> Van Ooijen Technische Informatica: www.voti.nl
> consultancy, development, PICmicro products
> docent Hogeschool van Utrecht: www.voti.nl/hvu
Reply by monger_39●June 16, 20092009-06-16
--- In l..., Wouter van Ooijen wrote: >
> >> I am working on a tool for writing RAM applications. I want to give
>
> I meant ARM applications...
>
> > If you need to manage a scalable font
>
> no, I want to provide the user an easy way tom include a bitmapped font
> into the application. So far ttf/otf seems to be an easy source of
> fonts. Note that all processing of the ttf/otf format into bitmaps is
> done on the PC, not in the ARM application.
>
> X11 pcf seems to be a standard for bitmapped fonts, but I have not found
> an abundance of free pcf fonts.