0

LOGFONT has an lfClipPrecision field:

The clipping precision defines how to clip characters that are partially outside the clipping region.

Possible values of the enum are described here: ClipPrecision Flags

The descriptions are a bit vague, so for CLIP_STROKE_PRECIS we get:

This value MAY be returned when enumerating rasterized, TrueType and vector fonts.

My question is, what does it mean to have clip precision equal to CLIP_STROKE_PRECIS? Do I let partial character overflows slip past the clipping region's boundary and not be clipped? Or do I clip a stroke if it does not entirely fit within the clipping region, subsequently leaving a partial character?

Likewise, for CLIP_DFA_DISABLE:

This value specifies that font association SHOULD be turned off.

To clip or not to clip, that is the question...

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
A B
  • 85
  • 1
  • 6
  • There are few examples of using `CLIP_STROKE_PRECIS` parameter. I didn't find the difference, can you describe it in more detail? It would be better if you could add relevant screenshots. – Strive Sun Mar 04 '21 at 06:29
  • The only description of `CLIP_STROKE_PRECIS` I could find is in the link. Not sure what screenshots you have in mind. The context of the problem is building an EMF viewer. – A B Mar 04 '21 at 09:40
  • Can you add a minimal example in the question? – Strive Sun Mar 05 '21 at 08:29
  • Unfortunately the actual code example would not be that minimal, was just hoping that someone is familiar with Windows API that could explain the usage of the enum values. – A B Mar 05 '21 at 12:15
  • [LOGFONTA](https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-logfonta) provided more information. For compatibility, this value is always returned when enumerating fonts. When I use `EnumFontFamiliesEx` to enumerate fonts, the `lfClipPrecision` parameter will always return the `CLIP_STROKE_PRECIS` value. This is consistent with the behavior stated in the documentation. For clipping precision, I did some tests, not sure where it was used. Maybe you can provide some code for my reference. – Strive Sun Mar 12 '21 at 09:22

0 Answers0