dcsimg
Page 4 of 4 FirstFirst 1234
Results 121 to 126 of 126

Thread: The 1001 questions about vbRichClient5 (2019-08-19)

  1. #121
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,098

    Re: The 1001 questions about vbRichClient5 (2019-08-14)

    You may also want to play with the .SetLineCap and .SetLineJoin values for the context - these can make a difference, too.

    Also, a lot of my older RC5 projects have the line cairo.FontOptions=CAIRO_ANTIALIAS_DEFAULT somewhere in them, immediately after instantiating Cairo. For reasons I never quite understood (given that I was, apparently, setting to its default value!), it seemed like I always needed that to get nice font rendering.

    Perhaps Olaf would care to comment?
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  2. #122
    PowerPoster
    Join Date
    Jun 2013
    Posts
    4,376

    Re: The 1001 questions about vbRichClient5 (2019-08-14)

    Quote Originally Posted by ColinE66 View Post
    You may also want to play with the .SetLineCap and .SetLineJoin values for the context - these can make a difference, too.

    Also, a lot of my older RC5 projects have the line cairo.FontOptions=CAIRO_ANTIALIAS_DEFAULT somewhere in them, immediately after instantiating Cairo. For reasons I never quite understood (given that I was, apparently, setting to its default value!), it seemed like I always needed that to get nice font rendering.

    Perhaps Olaf would care to comment?
    The enum-values of cairo_antialias_enum (although numbering 4)
    are only 3 distinct values really - in the older cairo-version I use...
    (because enum-value CAIRO_ANTIALIAS_DEFAULT means the same thing as CAIRO_ANTIALIAS_GRAY)

    There's two Properties one can assign this enum to - and:
    Cairo.FontOptions = cairo_antialias_enum
    ...affects different things, compared to...
    CC.Antialias = cairo_antialias_enum

    The Cairo.FontOptions are for "true Text-Rendering" only - and its 3 distinct enum-settings will be applied only,
    in case the CC.TextOut or CC.DrawText were called without the optional PathOnly-Parameter.
    Here Cairo.FontOptions = CAIRO_ANTIALIAS_SUBPIXEL ist the mode with the highest quality in "true TextOutput mode"
    (it will render Texts using Windows-Cleartype in that mode, making use of the LCD-subpixels)

    In the other case... if a PathOnly-Boolean-Parameter was given with True,
    then the TextOutput is not using "real Font-Rendering" anymore,
    but falls back to "normal Cairo-Path-Rendering" (like any other Line- or Arc, or other Drawing-Primitive call).
    The advantage in PathOnly-mode is, that Text-placements - are then done with true SubPixel-precision
    (regarding the Character-Offsets, which is not the case in ClearType-Fontrendering-mode -
    in ClearType-mode the TextChars have to be "placed at hard PixelBoundaries", to make ClearType possible at all).

    So, the CC.Antialias-Setting is only influencing Cairos "normal Pathed-Output-Mode"
    (curves, lines, rectangles, etc. as well as "TextPaths").

    HTH

    Olaf

  3. #123
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,098

    Re: The 1001 questions about vbRichClient5 (2019-08-14)

    Thanks for that explanation, Olaf - that certainly clears-up a few things for me. When you talk about Text-placements and Offsets, does this have a bearing on the return values from GetTextExtents, by any chance? I ask because, recently, I had a situation whereby I was only ever seeing whole numbers when measuring character widths, and was expecting some decimal precision.
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  4. #124
    PowerPoster
    Join Date
    Jun 2013
    Posts
    4,376

    Re: The 1001 questions about vbRichClient5 (2019-08-14)

    Quote Originally Posted by ColinE66 View Post
    Thanks for that explanation, Olaf - that certainly clears-up a few things for me. When you talk about Text-placements and Offsets, does this have a bearing on the return values from GetTextExtents, by any chance? I ask because, recently, I had a situation whereby I was only ever seeing whole numbers when measuring character widths, and was expecting some decimal precision.
    Yep, GetTextExtents tends to delivers "whole numbers",
    when CC.SelectFont was using a Font with a "normal size" (8-25pt),
    and when no CC.ScaleDrawings was in place (the Scale still being at their default-factor 1).

    If you *use* Path-based Textrendering calls (with the PathOnly-Param at True),
    then you can (shortly before the Stroke, or Fill - where the Path is still "active" and not closed),
    do something like that for precise path-measurement:
    Code:
        Dim X1#, Y1#, X2#, Y2#
        CC.GetPathExtents X1, Y1, X2, Y2
        Debug.Print X1, X2, X2 - X1 'shows X1, X2 and the X-Distance
    HTH

    Olaf

  5. #125
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,098

    Re: The 1001 questions about vbRichClient5 (2019-08-14)

    Aah, of course - GetPathExtents. Never occurred to me...
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  6. #126

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2012
    Posts
    1,605

    Re: The 1001 questions about vbRichClient5 (2019-08-14)

    Quote Originally Posted by reexre View Post
    hi dreammanor
    do you think other people can add questions about vbRichClient here? (or you prefer to keep it some kind of your?)
    because I wanted to ask for a fairly simple one.
    [If you prefer me not do it here anymore (or that I do it using some particular manner/format) let me know]

    Ok, my question:
    Wich is the best/fastest way to draw on a cCairoSurface an OutLine text ? (maybe using DrawText)
    Hi reexre, all questions about RC5 are welcome.

    My intention is to give RC5 developers a convenient place to ask questions and discuss. I've added your question to the question list in the post #1.

Page 4 of 4 FirstFirst 1234

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width