Re: Kanji bit-mapped font

new topic     » goto parent     » topic index » view thread      » older message » newer message

Craig Welch wrote:
> 
> irv mullins wrote:
> > 
> > Craig Welch wrote:
> > 
> > > But I'm at a loss as to how to do this in Euphoria/Windoze. These are not
> > > Windoze fonts, so it's not just a matter of doing a Windoze instal. I need
> > > to read the font, and render it into a field ... or straight onto the
> > > window, I guess. 
> > 
> > Take a look at:
> > <a
> > href="http://user.dtcc.edu/~berlin/font/japanese.htm">http://user.dtcc.edu/~berlin/font/japanese.htm</a>
> > 
> > These are TTF which look very good as big as 72 pt. 
> > The only drawback is if you are planning to sell your program, 
> > you'll need written permission to use the fonts.
> 
> Thanks Irv,
> 
> Truetype fonts don't work. They're fine in Microsoft applications such as 
> Office, but won't work in my Euphoria application. Hence my search for a 
> way to render a bitmap font.

You can simply write a True-Type font to a bitmap in RAM and then render
that on the screen. Here is starting point for you. It creates 26 bitmaps,
from "A" to "Z" in Times New Roman font at 200 point.

----------------------
without warning
include win32lib.ew

constant pm = create(Pixmap, "", 0, 0,0, 1,1, 0)
procedure DoLetter(sequence pText)
    sequence lTextRect
--    printf(1, "%s\n", {pText})
    lTextRect = getTextExtent(pm,pText)
    setCtlSize(pm, lTextRect[3], lTextRect[4])
    setBackColor(pm, BrightWhite)
    setPenColor(pm,Black)
    wPuts({pm, 0, 0}, pText)

    VOID = copyToBitmapFile(pm, pText[1] & ".bmp", 0, 0, 
                            lTextRect[3], lTextRect[4])

end procedure

setFont(pm, "Times New Roman", 200, 0)
for i = 'A' to 'Z' do
    DoLetter({i})
end for
----------------------



-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu