Bug 130163

Summary: "Lucida Grande" is hardcoded in RenderTextControlSingleLine.cpp
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: Layout and RenderingAssignee: Myles C. Maxfield <mmaxfield>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Myles C. Maxfield 2014-03-12 16:08:19 PDT
Not all platforms use this default font, and there should be one source of truth for what the default font is.
Comment 1 Ahmad Saleem 2023-07-02 16:13:13 PDT
We still have this: https://searchfox.org/wubkat/source/Source/WebCore/rendering/RenderTextControlSingleLine.cpp#337 & 


#if !PLATFORM(IOS_FAMILY)
    // Since Lucida Grande is the default font, we want this to match the width
    // of MS Shell Dlg, the default font for textareas in Firefox, Safari Win and
    // IE for some encodings (in IE, the default font is encoding specific).
    // 901 is the avgCharWidth value in the OS/2 table for MS Shell Dlg.
    if (style().fontCascade().firstFamily() == "Lucida Grande"_s)
        return scaleEmToUnits(901);
#endif

_______

https://searchfox.org/wubkat/source/Source/WebCore/rendering/RenderTextControlSingleLine.cpp#360


#if !PLATFORM(IOS_FAMILY)
    const AtomString& family = style().fontCascade().firstFamily();
    // Since Lucida Grande is the default font, we want this to match the width
    // of MS Shell Dlg, the default font for textareas in Firefox, Safari Win and
    // IE for some encodings (in IE, the default font is encoding specific).
    // 4027 is the (xMax - xMin) value in the "head" font table for MS Shell Dlg.
    if (family == "Lucida Grande"_s)
        maxCharWidth = scaleEmToUnits(4027);
    else if (style().fontCascade().hasValidAverageCharWidth())
        maxCharWidth = roundf(style().fontCascade().primaryFont().maxCharWidth());
#endif

_______