This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients cheryl.sabella, miss-islington, serhiy.storchaka, taleinat, terry.reedy, vstinner
Date 2020-02-10.21:49:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1581371350.23.0.981420346836.issue39600@roundup.psfhosted.org>
In-reply-to
Content
In LibreOffice, I see 4 flavors of "Cantarell" with different *weight* :

Cantarell
Cantarell Extra Bold
Cantarell Light
Cantarell Thin

whereas tkinter.font.families(frame) returns 4 times the same string: "Cantarell". The C function of Tk is TkpGetFontFamilies().

The X11 implementation uses XListFonts() which returns a string like "-foundry-family-weight-slant-(...)" but the function only returns the "family" substring: it ignores the foundy and the weight for example. So it's not surprising to get duplicates. Example: "-adobe-helvetica-bold-o-normal--11-80-100-100-p-60-iso8859-1" becomes "helvetica".

There is also a Xft implementation which uses XftListFonts(). Then it uses XftPatternGetString() to get a font family.

I see no logic in Tcl to exclude duplicated family names of different weights.

--

>>> tkinter.font.names(frame)
('TkCaptionFont', 'TkSmallCaptionFont', 'TkTooltipFont', 'TkFixedFont', 'TkHeadingFont', 'TkMenuFont', 'TkIconFont', 'TkTextFont', 'TkDefaultFont')

That's something different that I would call unrelated ;-)
History
Date User Action Args
2020-02-10 21:49:10vstinnersetrecipients: + vstinner, terry.reedy, taleinat, serhiy.storchaka, cheryl.sabella, miss-islington
2020-02-10 21:49:10vstinnersetmessageid: <1581371350.23.0.981420346836.issue39600@roundup.psfhosted.org>
2020-02-10 21:49:10vstinnerlinkissue39600 messages
2020-02-10 21:49:10vstinnercreate