This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PM: Graphic library ftrasterize font creation

Part Number: TM4C123GH6PM

Dear Sir,

I am using graphic library for font rendering in my project LED matrix display , I am using tool ( ftrasterize ) for font creation 

in ftrasterize option of font size given poits( -s)  when create with this I can able to get different font sizes for different points 

but it is not meeting our requirement  , I need to be generate as font size Width x Height   12x24 means 12  horizontal lines  of font width 24  Vertical lines of font height in our display 

Kindly help to resolve the issue.

  • Hi,

      I'm not familiar with how ftrasterize actually works.

      When you specify -s 24,  are you getting any errors? If no error, what did you get in terms of width and height?

      What font size actually works for you right now? I want to know if any size that is greater than or equal to 24 is not working. Or is it just 24 points. 

      What font did you specify? Is it possible that the font you specify does not support 24 points. Can you try another font. The input to ftrasterize is of xyz.ttf. An example of the font is like AndBas.R.ttf fireflysung.ttf  NanumMyeongjo-Regular.ttf sazanami-gothic.ttf. 

      The source code for ftrasterize is at C:\ti\TivaWare_C_Series-2.2.0.295\tools\ftrasterize. 

  • ftrasterize is working fine I want to create font size 12x24  width x height ,but it is  not getting as expected 

    please tell  how to make font 12x24 from the ttf file

  • Hi,

    ftrasterize is working fine I want to create font size 12x24  width x height ,but it is  not getting as expected

      First of all, I don't have knowledge about how ftrasterize works. Secondly,  you have not answered my questions. You only said it is not getting as expected. So what did you actually get? Below I repeat the same questions. 

     When you specify -s 24,  are you getting any errors? If no error, what did you get in terms of width and height?

      What font size actually works for you right now? I want to know if any size that is greater than or equal to 24 is not working. Or is it just 24 points. 

      What font did you specify? Is it possible that the font you specify does not support 24 points. Can you try another font. The input to ftrasterize is of xyz.ttf. An example of the font is like AndBas.R.ttf fireflysung.ttf  NanumMyeongjo-Regular.ttf sazanami-gothic.ttf. 

  • I use frasterize to generate 14p,16p, 18p, 20p, 22p, 24p, 26p fonts. I don't see a problem. 

  • Thanks for your replay 

     As per your direction I have created font and attached image please find 

    width of the font 24,

    height of the font 32,

    but i need width 12 and height 24, I have keep on trying different point sizes but never achieved   

  • Hi,

      The 24p I produce also don't have width of 12 but rather 21. But don't you think it looks better when the character is displayed at width x height = 21 x 24. Look at the display I produce from 14p to 26p. Don't you think 12 x 24 would have looked so narrow that may not look as nice. However, I think it is up to you how you want it. The point is that I don't think the problem is with frasterize tool. The tool takes the font library as input that you provide and produces the C file. I think it has more to do with the font library you provide. The source code for frasterize  is available in the /tool directory if you believe you need to modify it to produce what you want. 

    Can you also show a display of different font sizes like I did? I'm curious to know what you get for 24p and how they compare with other font sizes visually.

    const uint8_t g_pui8Custom24pt[] =
    {
        //
        // The format of the font.
        //
        FONT_FMT_WIDE_PIXEL_RLE,
    
        //
        // The maximum width of the font.
        //
        21,
    
        //
        // The height of the font.
        //
        24,
    
        //
        // The baseline of the font.
        //
        21,
    

  • Hi

    Actually my application is not Graphic display it is a LED dot matrix panel so that  i am specific to font size width and height can you suggest any alternate way to make fixed font size as we wish

  • HI,

     Sorry for lack of guidance. I don't know how to solve your problem. You need to find out if you are providing a font format that is recognized by FreeType. 

    The ftrasterize utility uses the FreeType font rendering package to convert a font into the format that
    is recognized by the graphics library. Any font that is recognized by FreeType can be used, which
    includes TrueType®, OpenType®, PostScript® Type 1, and Windows® FNT fonts. A complete list of
    supported font formats can be found on the FreeType web site at http://www.freetype.org.
    FreeType is used to render the glyphs of a font at a specific size in monochrome, using the result
    as the bitmap images for the font. These bitmaps are optionally compressed, and the results are
    written to to a file that provides a tFont, tFontEx or tFontWide structure describing the font. The
    output may be written in the form of a C source file which can be linked into an application directly
    or as a binary file allowing the font to be stored and used from non-linear memory or a file system
    assuming a suitable font wrapper is used.

    Did you also try the two different methods of specifying sizes? See below.

    -s <size> Specifies the size of this font. The size parameter make take one of two
    forms. If a decimal number, this specifies the text size in points. If the
    parameter is a capital “F” followed immediately by a decimal number, this
    selects one of the font’s fixed size encodings assuming the font supports
    these. To determine whether a font supports fixed sizes, use the “-d” switch
    to display font information. The default size is 20 points if not specified.

    Not sure if this below website will help.

    https://www.free-fonts.com/12-x-24-dots