TTF outline thickness/color, font style, font shadow, etc...

Issue #44 new
Benjamin Hoffmann created an issue

It would be nice to have these functionalities on ttf fonts :

Comments (4)

  1. Joseba Echevarria García repo owner

    Hi, thanks for your suggestions.

    Some random thoughts on what I've found while looking at your ideas:

    • The color of the font can currently be changed with set_text_color() and specifying a 32bpp color. Have a look at the TTF rendering example
    • SDL_ttf handles italics by applying shear to the outline with FT_Outline_Transform.
    • I'm not sure how they render bold text.
    • Text underline-strikethrough information is bundled in OpenType fonts, so the information needed to render text should be there (and should be as simple as drawing straight lines in the right places).

    With that in mind:

    • Underlining and strikethrough are something I'd definitely like to add at a later point.
    • Many font families provide italics, bold & italics + bold faces, as well as many other variations, as separate TTF files (see DejaVu font family), for example. IMHO it makes much more sense to use those than to unconditionally skew glyphs, which will probably be just wrong in many situations. I might be able to implement such behaviour in PixTudio, but the point of adding FreeType rendering is not to include a fully-featured text renderer right now.
    • Font shadows are probably out-of-scope right now. There are other areas of improvement I want to focus on.

    With that said, you can expect underline-striokethrough mid-term, but I won't probably be working on the rest of points anytime soon.

    Again, thanks for reporting.

  2. Log in to comment