mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-07 17:43:53 +02:00
Fix spec generation for auto setting
This commit is contained in:
@@ -131,6 +131,7 @@ def render_face_sample(font: Descriptor, opts: Options, dpi_x: float, dpi_y: flo
|
||||
'psname': face.postscript_name(),
|
||||
'features': get_features(face.get_features()),
|
||||
'applied_features': face.applied_features(),
|
||||
'spec': spec_for_face(font['family'], face).as_setting,
|
||||
'cell_width': 0, 'cell_height': 0, 'canvas_height': 0, 'canvas_width': width,
|
||||
}
|
||||
if is_variable(font):
|
||||
|
||||
@@ -33,8 +33,15 @@ func (self *face_panel) new_font_spec() (*FontSpec, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if fs.system.val == "auto" {
|
||||
if fs, err = NewFontSpec(self.current_preview.Spec, self.current_preview.Features); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
fs.family = settable_string{self.family, true}
|
||||
fs.variable_name = settable_string{self.current_preview.Variable_data.Variations_postscript_name_prefix, true}
|
||||
if len(self.current_preview.Variable_data.Axes) > 0 {
|
||||
fs.variable_name = settable_string{self.current_preview.Variable_data.Variations_postscript_name_prefix, true}
|
||||
}
|
||||
return &fs, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ type RenderedSampleTransmit struct {
|
||||
Variable_data VariableData `json:"variable_data"`
|
||||
Style string `json:"style"`
|
||||
Psname string `json:"psname"`
|
||||
Spec string `json:"spec"`
|
||||
Features map[string]FeatureData `json:"features"`
|
||||
Applied_features map[string]string `json:"applied_features"`
|
||||
Variable_named_style NamedStyle `json:"variable_named_style"`
|
||||
|
||||
Reference in New Issue
Block a user