Overview
Artifact ID: | 38d7ee1e0a09f25539579970ec34bec89b15d196 |
---|---|
Ticket: | c0dbdd3ff35697b57935f7d16e47336ca5043277
Tk Compatibility Fonts block access to system fonts |
User & Date: | fvogel 2016-12-02 21:57:37 |
Changes
- assignee changed to: "fvogel"
- icomment:
Sorry, my link below was in fact not relevant. A less superficial analysis of what is happening when calling <code>font actual Courier</code> (on Windows, which is the case for the present report) is as follows: <code>Tk_FontObjCmd()</code>: case FONT_ACTUAL looks for the font named "Courier" by calling <code>Tk_AllocFontFromObj()</code>. This call first looks (<code>TkpGetNativeFont()</code>) for a native font of this name. There is none, therefore it tries to find the closest matching font by calling <code>TkpGetFontFromAttributes()</code>. <code>TkpGetFontFromAttributes()</code> first tries the font name, "Courier", and looks if a font family or an alias exists: <code>FamilyOrAliasExists()</code>, which first calls <code>FamilyExists()</code>. And in <code>FamilyExists()</code> there is an [http://core.tcl.tk/tk/artifact/cad11b506ccb619d?ln=2528,2542|intentional rule out of "Courier" font]. Removing those lines in the source code makes <code>font actual Courier</code> return: <pre> -family Courier -size 12 -weight normal -slant roman -underline 0 -overstrike 0</pre> This has been in Tk since 1999, and the reason why it's there looks valid to me.
- login: "fvogel"
- mimetype: "text/x-fossil-wiki"