Why are so many fonts so generic looking when drawing to a canvas?

  1. 8 months ago

    I am running into a new issue where so many fonts from my font menu appear generic when I am drawing them to the canvas. I am using .SetFont like I have been for years, but has Xojo changed anything in the latest IDEs?

  2. Dave S

    15 Apr 2018 San Diego, California USA

    Example of your code?
    Platform?

    and what exactly is "SETFONT"?

    normally you would say something like

    myTextfield.font="Courier"

    And also..... there was a change (Apples doing, not Xojo) where only the "Font Family" is exposed...
    so if the "name" you provide is not recoginized..... it will default to some other font.... THAT might be what you are seeing

  3. Emile S

    15 Apr 2018 Europe (France, Strasbourg)

    Base font ("Courier") or variant (Italic, Bold, etc.) ?

  4. How do I force the font list to produce only compatible fonts to avoid this issue?

  5. Michel B

    16 Apr 2018 Pre-Release Testers RubberViews.com
    Edited 8 months ago

    The method at http://docs.xojo.com/index.php/Font does return all valid fonts. In Windows, that is really all the fonts with their stylistic variations (bold, italic, bolditalic, underlined, and so on).

    On Mac the same method shows the font families, but not the stylistic variations. That would require a declare or a plugin. But all the fonts obtained are valid.

    1. Which platform are you using ?

    2. Could you post your code ?

    3. What is this ".setfont" method you are referring to ? Is it a method of yours ? If so, can you post the code ?

  6. Greg O

    16 Apr 2018 Xojo Inc

    @Michel B The method at http://docs.xojo.com/index.php/Font does return all valid fonts. In Windows, that is really all the fonts with their stylistic variations (bold, italic, bolditalic, underlined, and so on).

    On Mac the same method shows the font families, but not the stylistic variations. That would require a declare or a plugin. But all the fonts obtained are valid.

    That’s a good point, however remember that there are fonts included with macOS which seem to render generically on a computer with a European language because all of their characters are Unicode. Like Kanji for example.

    So yes, it would be helpful to know which fonts you are trying to use.

  7. Sorry, I should have been more specific. I know I can generate a valid list using the code example from the language reference, but I am actually working with PostScript font names. If I use FamilyName I won't be able to pass off (easily) the correct PostScript name for another aspect of my app.

  8. Michel B

    16 Apr 2018 Pre-Release Testers RubberViews.com

    You know, if you want to obtain valid answers, it is much better to give all the context.

    @Michel B 1. Which platform are you using ?

    2. Could you post your code ?

    3. What is this ".setfont" method you are referring to ? Is it a method of yours ? If so, can you post the code ?

    If you don't care to provide valid information, you will get the wrong replies.

    Garbage in, garbage out. Old programming proverb.

  9. Emile S

    16 Apr 2018 Europe (France, Strasbourg)

    InCanvas1.Paint Event:

    g.TextFont = "Courier"
    g.DrawString "Courier",10,10
    
    g.TextFont = "Courier Bold"
    g.DrawString "Courier Bold",10,30
    
    g.TextFont = "Courier-Bold"
    g.DrawString "Courier-Bold",10,50
    
    g.TextFont = "CourierBold" // Not displayed with Bold…
    g.DrawString "CourierBold",10,70

    Only the last is wrong: CourierBold. With a space or with a '-' print the text in Bold.

    What are-you using ?

    Tooks more time to run Xojo 2017r3 than to write it.

  10. Emile S

    16 Apr 2018 Europe (France, Strasbourg)

    @Matthew J am actually working with PostScript font names

    That means Courier-Bold, isn’t it ?

    Nota: I do not understand what Postscript comes to Xojo’s Canvas…

  11. Emile S

    17 Apr 2018 Europe (France, Strasbourg)

    EIther the OP found a solution (understand his prolem) or give away that feature…

or Sign Up to reply!