mirror of
https://github.com/danbulant/cushy
synced 2026-06-19 06:21:15 +00:00
Fixing set_font_family to not be sticky
This commit is contained in:
parent
f8cb7e7f32
commit
c242009cb8
2 changed files with 8 additions and 0 deletions
|
|
@ -86,6 +86,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
that was incorrectly being applied to the lightness contrast calculation. In
|
||||
short, this function should be much more accurate in perceived contrast
|
||||
evaluation.
|
||||
- `Graphics::set_font_family` now clears the cached font family list, ensuring
|
||||
that the next call to apply_current_font_settings works correctly.
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,12 @@ impl<'clip, 'gfx, 'pass> Graphics<'clip, 'gfx, 'pass> {
|
|||
)
|
||||
}
|
||||
|
||||
/// Sets the current font family.
|
||||
pub fn set_font_family(&mut self, family: cosmic_text::FamilyOwned) {
|
||||
self.font_state.current_font_family = None;
|
||||
self.renderer.set_font_family(family);
|
||||
}
|
||||
|
||||
/// Returns the first font family in `list` that is currently in the font
|
||||
/// system, or None if no font families match.
|
||||
pub fn find_available_font_family(&mut self, list: &FontFamilyList) -> Option<FamilyOwned> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue