Skip to content

Consider Updating LOGFONTW #1060

Closed

Description

@lonitra

LOGFONTW docs outline enum-like typed values for certain members of its struct e.g. lfOutPrecision,lfQuality. It would be nice to update the definition to return an enum type for these members for readability.
For example, with lfOutPrecision, something like:

public enum OUT_PRECIS : byte
{
    DEFAULT = 0,
    STRING = 1,
    CHARACTER = 2,
    STROKE = 3,
    TT = 4,
    DEVICE = 5,
    RASTER = 6,
    TT_ONLY = 7,
    OUTLINE = 8,
    SCREEN_OUTLINE = 9,
    PS_ONLY = 10
}

The docs also outline an LF_FACESIZE, which indicates the size of lfFaceName. Currently, the type of lfFaceName has a property Length which is essentially the LF_FACESIZE, but it would be nice to have this defined as an internal const in LOGFONTW to be able to reference this without having to first create one i.e. reference this value by calling LOGFONTW.LF_FACESIZE.

Activity

  1. elachlan commented on Aug 18, 2022

    @elachlan
    Contributor
  2. elachlan commented on Aug 19, 2022

    @elachlan
    Contributor

    For FONT_WEIGHT its is defined as LONG lfWeight.

    The structures CHARFORMAT2W/CHARFORMAT2A have a WORD wWeight field. The description says:

    this member is the same as the lfWeight member of the LOGFONT structure. To use this member, set the CFM_WEIGHT flag in the dwMask member.

    If I include it, the build fails.

    Similar issue with FONTDIFF/IFIMETRICS and their field USHORT usWinWeight.

    Steve Otteson (@sotteson1) How do you reconcile that difference?

  3. added
    missing enum
    on Aug 19, 2022
  4. AArnott commented on Aug 19, 2022

    @AArnott
    Member

    An enum can only have one size, so if the enum would tend to apply to sites that individually vary in size, we cannot share an enum between them. We could define the enum twice (with names to suggest their length), but I think we usually leave the enum undefined in such cases since it's perhaps not as cut-and-dry that it's a well-defined type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    missing enum

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions