-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1697 from iced-rs/text-glyphon
Text shaping, font fallback, and `iced_wgpu` overhaul
- Loading branch information
Showing
94 changed files
with
1,639 additions
and
5,387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,45 @@ | ||
//! Load and use fonts. | ||
use std::hash::Hash; | ||
|
||
/// A font. | ||
#[derive(Debug, Clone, Copy)] | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
pub enum Font { | ||
/// The default font. | ||
/// | ||
/// This is normally a font configured in a renderer or loaded from the | ||
/// system. | ||
Default, | ||
/// The name of a font family of choice. | ||
Name(&'static str), | ||
|
||
/// Serif fonts represent the formal text style for a script. | ||
Serif, | ||
|
||
/// Glyphs in sans-serif fonts, as the term is used in CSS, are generally low | ||
/// contrast and have stroke endings that are plain — without any flaring, | ||
/// cross stroke, or other ornamentation. | ||
SansSerif, | ||
|
||
/// Glyphs in cursive fonts generally use a more informal script style, and | ||
/// the result looks more like handwritten pen or brush writing than printed | ||
/// letterwork. | ||
Cursive, | ||
|
||
/// An external font. | ||
External { | ||
/// The name of the external font | ||
name: &'static str, | ||
/// Fantasy fonts are primarily decorative or expressive fonts that contain | ||
/// decorative or expressive representations of characters. | ||
Fantasy, | ||
|
||
/// The bytes of the external font | ||
bytes: &'static [u8], | ||
}, | ||
/// The sole criterion of a monospace font is that all glyphs have the same | ||
/// fixed width. | ||
Monospace, | ||
} | ||
|
||
impl Default for Font { | ||
fn default() -> Font { | ||
Font::Default | ||
} | ||
/// The weight of some text. | ||
#[allow(missing_docs)] | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
pub enum Weight { | ||
Thin, | ||
ExtraLight, | ||
Light, | ||
Normal, | ||
Medium, | ||
Semibold, | ||
Bold, | ||
ExtraBold, | ||
Black, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
examples/integration_wgpu/Cargo.toml → examples/integration/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.