mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-04 18:28:02 +00:00
fix: try getting font index again (#1213, #1645) (#1790)
Some checks are pending
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Some checks are pending
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This commit is contained in:
parent
08a104cd9c
commit
646dd81a35
1 changed files with 5 additions and 5 deletions
|
@ -178,9 +178,9 @@ impl FontResolverImpl {
|
|||
None
|
||||
}
|
||||
|
||||
/// Describes the source of a font by id.
|
||||
pub fn describe_font_by_id(&self, id: usize) -> Option<Arc<DataSource>> {
|
||||
self.slots[id].description.clone()
|
||||
/// Describes the source of a font by index.
|
||||
pub fn describe_font_by_id(&self, index: usize) -> Option<Arc<DataSource>> {
|
||||
self.slot(index)?.description.clone()
|
||||
}
|
||||
|
||||
pub fn with_font_paths(mut self, font_paths: Vec<PathBuf>) -> Self {
|
||||
|
@ -198,8 +198,8 @@ impl FontResolver for FontResolverImpl {
|
|||
self.slots.get(idx)
|
||||
}
|
||||
|
||||
fn font(&self, idx: usize) -> Option<Font> {
|
||||
self.slots[idx].get_or_init()
|
||||
fn font(&self, index: usize) -> Option<Font> {
|
||||
self.slot(index)?.get_or_init()
|
||||
}
|
||||
|
||||
fn get_by_info(&self, info: &FontInfo) -> Option<Font> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue