Commit graph

82 commits

Author SHA1 Message Date
David Stern
73acfb0962 Cache rustybuzz shape plans. 2023-12-18 18:19:27 -05:00
hz
ed67add28a Don't use Emoji fonts as monospace fallback 2023-11-04 14:31:18 +01:00
Jeremy Soller
30398c2f0c
Merge pull request #188 from EHfive/use_self_cell
Use self_cell for creating self-referential struct
2023-09-18 12:25:02 -06:00
Huang-Huang Bao
331710a16f
Use self_cell for creating self-referential struct
Remove indigenous unsafe self-referential implemention which has a lesser chance to be audited.
2023-09-19 02:16:23 +08:00
Héctor Ramón Jiménez
9d1d5a54c6
Respect fontconfig font aliases when enabled 2023-09-18 19:59:35 +02:00
John Nunley
64e469718b Use a scratch buffer to reduce allocations
This commit adds a new ShapeBuffer type, which contains some buffers tha
are commonly re-created during the shaping process. New APIs are added
that take this structure, and old APIs are turned into wrappers around
the new API.

The goal is to reduce the number of per-layout allocations that happen
in a typical layout call.
2023-08-16 14:09:54 -07:00
grovesNL
c4d107563a Require either std or no_std to be specified 2023-08-09 11:44:20 -02:30
grovesNL
14d0ceb81b Move hashbrown behind no_std feature 2023-08-09 10:19:24 -02:30
John Nunley
2509fc21e2
Fix a warning 2023-07-24 18:09:31 -07:00
John Nunley
7b289c945b
Fix no_std build 2023-07-24 17:57:46 -07:00
John Nunley
faa1ceafda Unify the no_std and std impls of FontSystem 2023-07-24 08:51:19 -07:00
Jeremy Soller
bd58940c42
Merge pull request #153 from forkgull/more-debug
Add more Debug implementations
2023-07-24 09:45:58 -06:00
John Nunley
e65bcbc4d3
Change to a feature 2023-07-22 08:24:28 -07:00
John Nunley
831e025cb1
Upgrade missing glyphs to a warning
It is annoying to have to grep through DEBUG logs for this.
2023-07-21 18:04:00 -07:00
John Nunley
440d24ffa0
Add more Debug implementations
I generally like to implement Debug on these kind of types.
2023-07-07 21:44:21 -07:00
Jeremy Soller
39895c988a
Merge pull request #132 from trimental/monospaced-fallback
Fallback to monospaced font if Monospace family is not found
2023-06-08 12:38:17 -06:00
Jeremy Soller
f0becfdb54
Fix comment typo 2023-06-08 12:32:34 -06:00
bjorn3
95e36249d5 Remove the dependency on ouroboros
This reduces compilation time by removing a dependency on syn and other
dependencies of ouroboros_macros. In addition it saves a lot of unused
codegened methods.

On my laptop (2 core + HT) this reduces compilation time by ~20%. On a
many core system this doesn't help much though as the critical path path
consists of both ttf-parser -> rustybuzz and swash. Further gains will
likely need to be made by reducing compilation time for these crates.

Benchmark 1: cargo build
  Time (mean ± σ):     25.150 s ±  0.167 s    [User: 84.414 s, System: 7.335 s]
  Range (min … max):   24.909 s … 25.444 s    10 runs

Benchmark 1: cargo build
  Time (mean ± σ):     19.819 s ±  0.226 s    [User: 67.754 s, System: 5.592 s]
  Range (min … max):   19.492 s … 20.140 s    10 runs

The code is based on an expansion of the ouroboros macro, cleaned up to
remove all unused methods and inline most functions that are only called
once.
2023-06-08 18:00:42 +02:00
Lucas Timmins
e1e9fb5215 Fallback to monospaced font if Monospace family is not found 2023-05-20 02:05:52 +08:00
Christopher Serr
71281a5d79 Fix FontSystem::new_with_locale_and_db Signature
It turns out that the `no_std` version of
`FontSystem::new_with_locale_and_db` doesn't match the `std` version.
This fixes that.
2023-03-29 22:36:54 +02:00
Christopher Serr
8a14734033 Expose rustybuzz in the public API
This exposes `rustybuzz` on top of `fontdb`. This is in particular
useful if you want to query the font for additional information. This is
already publically exposed via `Font::rustybuzz()`, but the types were
not re-exported, so it was impossible to properly use that function.
2023-03-27 23:08:32 +02:00
Edgar Geier
d297a6a48a
Call get_font lazily 2023-03-14 00:39:50 +01:00
Edgar Geier
f86acd325c
Lazily call make_shared_face_data 2023-03-13 11:15:36 +01:00
Edgar Geier
af4378d753
Add db_mut method to FontSystem 2023-03-12 10:39:58 +01:00
Edgar Geier
3331f41d7a
Improve documentation 2023-03-12 10:39:57 +01:00
Edgar Geier
384c5c1fdc
Remove Mutex from FontSystem 2023-03-12 10:39:56 +01:00
Edgar Geier
46e9ef0246
Make BorrowedWithFontSystem borrow FontSystem mutably 2023-03-12 10:39:56 +01:00
Edgar Geier
057b5b6fa9
Extract borrow of FontSystem from Buffer 2023-03-12 10:39:54 +01:00
Edgar Geier
bff5aaaea3
Make FontSystem not self-referencing 2023-03-12 10:23:54 +01:00
Jeremy Soller
c4a8d521f6 Add default Redox font directory (/ui/fonts) 2023-03-08 21:01:53 -07:00
Jeremy Soller
e43cc03354 Use std font system for redox 2023-03-08 20:44:26 -07:00
Edgar Geier
2c1d564d62
Update fontdb dependency to version 0.13 2023-03-03 13:07:49 +01:00
Jeremy Soller
eca804c732
Revert "Make FontSystem not self-referencing and update fontdb and rustybuzz" 2023-03-02 18:16:57 -07:00
Edgar Geier
f8bc71af0a
Update fontdb dependency to version 0.13 2023-03-03 00:53:00 +01:00
Edgar Geier
750d988429
Make FontKey repr(transparent) if swash feature is disabled 2023-03-03 00:53:00 +01:00
Edgar Geier
506a4194be
Make FontSystem not self-referencing 2023-03-03 00:53:00 +01:00
jtnunley
7098ee62e2 fmt 2023-03-01 13:36:29 -08:00
jtnunley
e00964fccf Add a warning about FontSystem::new() 2023-03-01 13:16:13 -08:00
Héctor Ramón Jiménez
655de0af5f
Implement FontSystem::new_with_fonts helper
This helper is useful to initialize a `FontSystem` with some embedded
fonts, for instance.
2023-02-04 11:30:41 +01:00
Héctor Ramón Jiménez
66288ab2da
Fix Noto Color Emoji font fallback order for Unix 2023-01-31 06:08:07 +01:00
grovesNL
a3e035881b Fill out some more docs 2023-01-29 22:29:17 -03:30
Audrey Dutcher
a5903bb3bf Don't do profile timing on wasm32 2023-01-23 14:18:44 -07:00
Audrey Dutcher
e00109d77f Downgrade some logging messages 2023-01-05 21:51:10 -07:00
Jeremy Soller
8cc988d374 Run cargo fmt 2023-01-04 20:03:03 -07:00
Audrey Dutcher
c5a5913981 re-export fontdb 2023-01-04 18:41:26 -07:00
Audrey Dutcher
58d292a6f1 Add FontSystem::into_locale_and_db for std system 2023-01-04 18:41:26 -07:00
Audrey Dutcher
06ad8ff7fb run cargo check next time thx 2023-01-04 18:41:26 -07:00
Audrey Dutcher
5533af1a53 Add FontSystem::new_with_locale_and_db for std system 2023-01-04 18:41:26 -07:00
Jeremy Soller
05d97f0f3a
Make noto color emoji have a higher preference for fallback 2022-12-02 08:41:38 -07:00
Jasper Bekkers
6249b0e037
🍮 Add custom font support (#43)
* 🍮 Add custom font support

* Revert incorrect change
2022-11-21 04:36:18 -07:00