-
Notifications
You must be signed in to change notification settings - Fork 63
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 #269 from rockyzhengwu/master
feat: charmap api
- Loading branch information
Showing
3 changed files
with
55 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use freetype_sys::FT_CharMap; | ||
|
||
pub struct CharMap { | ||
raw: FT_CharMap, | ||
} | ||
|
||
impl CharMap { | ||
pub fn new(raw: FT_CharMap) -> Self { | ||
CharMap { raw } | ||
} | ||
|
||
pub fn platform_id(&self) -> u16 { | ||
unsafe { (*self.raw).platform_id } | ||
} | ||
|
||
pub fn encoding_id(&self) -> u16 { | ||
unsafe { (*self.raw).encoding_id } | ||
} | ||
|
||
pub fn encoding(&self) -> u32 { | ||
unsafe { (*self.raw).encoding } | ||
} | ||
|
||
pub fn raw(&self) -> FT_CharMap { | ||
self.raw | ||
} | ||
} |
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