Fix automatic DPI adjustment and add workarounds for some systems
* lisp/faces.el (x-create-frame-with-faces): New field
`delayed-font'. Set the `font-parameter' property to `font' in
the given parameter list after face-set-after-frame-default is
called.
* src/fontset.c (Fset_fontset_font): Avoid changing
`font-parameter' with the call to Fmodify_frame_parameters.
* src/frame.c (gui_set_frame_parameters_1): New function.
Factor out gui_set_frame_parameters here, and add an argument
DEFAULT_PARAMETER. If the `font' parameter is set, and
`default_parameter' is not, then set the `font-parameter' frame
parameter to the `font' parameter as well, to keep track of
which user-specified `font' frame parameter set the default
face's font on the frame.
(gui_set_frame_parameters): Call gui_set_frame_parameters_1 with
new arg set to false.
(gui_set_font): Remove broken implementation of
`font-parameter'.
(gui_default_parameter): If the default value was used, then
call gui_set_frame_parameters_1 with the new argument set to
false. This is because no font was specified as a frame
parameter by the user, so Freconsider_frame_fonts is free to do
anything it wants.
(Freconsider_frame_fonts): If `font-parameter' is set, then use
it.
(syms_of_frame): New defsym Qfont_parameter.
* src/frame.h: Update prototypes.
* src/haikuterm.c (haiku_default_font_parameter):
* src/pgtkfns.c (pgtk_default_font_parameter):
* src/w32fns.c (w32_default_font_parameter): Stop setting
`font-parameter' here. This code resulted in decades of
automatic font rescaling not working correctly.
* src/xfaces.c (set_font_frame_param): Clear the
`font-parameter' frame parameter.
(Finternal_merge_in_global_face):
* src/xfns.c (x_default_font_parameter): Avoid changing
`font-parameter' in response to changes to face attributes.
* src/xsettings.c (apply_xft_settings): Add workaround for
Cairo. (bug#59371, bug#59347, bug#59283, bug#59271, bug#59285,
bug#59306.)