> From: Jason Rumney <jasonrum...@gmail.com> > Date: Thu, 12 Sep 2024 20:08:48 +0900 > Cc: help-emacs-windows@gnu.org > > The current font handling code for Windows was written in 1998 based > on the APIs available in NT 3.5, 4.0 and Windows 95. > There is support for other weights, but Windows and X use different > numeric values for font weight, so the mapping from Emacs font > string type "light" (based on X conventions) to Windows may not be > perfect - you may need to try "extralight" instead.
We do convert between X and Windows numerical values of weight (and back), so I think this is not the reason. The code in Emacs for finding a font matching a font spec requests all the matching fonts from the system, and then selects the closest match. Since the list of fonts for a family returned by the API we use does not include anything except the 4 basic styles, this strategy cannot work. > The standard font dialog in those old versions of Windows only supported > Bold and Normal weights, so I would not be surprised if the API used to > list fonts does not return all the available weights for modern fonts that > support a wide range of weights within the same font file. There is > probably a more modern way of handling fonts that could be used here, > but I haven't kept up with Windows APIs so I would not be the right > person to tackle it. Like I said: if someone knows a better API to use, please tell.