aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx/platform/macos/font_template.rs
Commit message (Collapse)AuthorAgeFilesLines
* fonts: Rework platform font initialization (#32127)Mukilan Thiyagarajan2024-04-221-74/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change reworks the way that platform fonts are created and descriptor data is on `FontTemplate` is initialized. The main change here is that platform fonts for local font faces are always initialized using the font data loaded into memory from disk. This means that there is now only a single path for creating platform fonts. In addition, the font list is now responsible for getting the `FontTemplateDescriptor` for local `FontTemplate`s. Before the font had to be loaded into memory to get the weight, style, and width used for the descriptor. This is what fonts lists are for though, so for every platform we have that information before needing to load the font. In the future, hopefully this will allow discarding fonts before needing to load them into memory. Web fonts still get the descriptor from the platform handle, but hopefully that can be done with skrifa in the future. Thsese two fixes together allow properly loading indexed font variations on Linux machines. Before only the first variation could be instantiated. Fixes https://github.com/servo/servo/issues/13317. Fixes https://github.com/servo/servo/issues/24554. Co-authored-by: Martin Robinson <mrobinson@igalia.com> ---- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #13317 and #24554 - [x] There are tests for these changes --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* gfx: Remove `FontTemplateData` (#32034)Martin Robinson2024-04-161-157/+48
| | | | | | | | | | | | | | | | | | | Now that `FontTemplateData` is more or less the same on all platforms, it can be removed. This is a preparatory change for a full refactor of the font system on Servo. The major changes here are: - Remove `FontTemplateData` and move its members into `FontTemplate` - Make `FontTemplate` have full interior mutability instead of only the `FontTemplateData` member. This is preparation for having these data types `Send` and `Sync` with locking. - Remove the strong/weak reference concept for font data. In practice, all font data references were strong, so this was never fully complete. Instead of using this approach, the new font system will use a central font data cache with references associated to layouts. - The `CTFont` cache is now a global cache, so `CTFont`s can be shared between threads. The cache is cleared when clearing font caches. A benefit of this change (apart from `CTFont` sharing) is that font data loading is platform-independent now.
* dependencies: Upgrade to WebRender 0.64 (#31486)Martin Robinson2024-03-141-2/+8
| | | | | | | | | This brings the version of WebRender used in Servo up-to-date with Gecko upstream. The big change here is that HiDPI is no longer handled via WebRender. Instead this happens via a scale applied to the root layer in the compositor. In addition to this change, various changes are made to Servo to adapt to the new WebRender API. Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* fonts: Add `FontIdentifier` and `LocalFontIdentifier` (#31658)Martin Robinson2024-03-141-108/+51
| | | | | | | | | | | | | | | | | | | Instead of using a simple `Atom` to identify a local font, use a data structure. This allows us to carry more information necessary to identify a local font (such as a path on MacOS). We need this for the new version of WebRender, as fonts on MacOS now require a path. This has a lot of benefits: 1. We can avoid loading fonts without paths on MacOS, which should avoid a lot of problems with flakiness and ensure we always load the same font for a given identifier. 2. This clarifies the difference between web fonts and local fonts, though there is more work to do here. 3. This avoid a *lot* of font shenanigans, such as trying to work backwards from the name of the font to the path of the font we actually matched. In general, we can remove a lot of code trying to accomplish these shenanigans. 4. Getting the font bytes always returns an `Arc` now avoiding an extra full font copy in the case of Canvas.
* style: Remove dependency on servo_url (#31358)Martin Robinson2024-02-161-1/+0
| | | | | In order for stylo to be a separate crate, it needs to depend on less things from Servo. This change makes it so that stylo no longer depends on servo_url.
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-10/+10
| | | | | * strict imports formatting * Reformat all imports
* When instantiating a CTFont, store the bytes that were used to create it.Josh Matthews2020-08-071-8/+25
|
* rustfmtJosh Matthews2019-10-071-7/+4
|
* macos: Remove font size attribute from font descriptor.Josh Matthews2019-10-071-4/+0
|
* Avoid Core Text font loading from postscript names due to intermittent ↵Josh Matthews2019-10-021-2/+43
| | | | incorrect behaviour.
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Remove useless `use crate_name;` imports.Simon Sapin2018-11-081-1/+0
| | | | A `crate_name::foo` path always works in 2018
* Reorder importsPyfisch2018-11-061-2/+2
|
* Format remaining filesPyfisch2018-11-061-2/+4
|
* Format gfx platform #21373kingdido9992018-09-051-27/+42
|
* Make FontTemplateData's Debug formatter more conciseJon Leighton2018-02-221-1/+18
| | | | | Otherwise the log gets spammed with all the individual bytes of the underlying font file.
* WR multi-document supportDzmitry Malyshau2017-11-221-5/+5
|
* order derivable traits listsClément DAVID2017-08-231-1/+1
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Upgrade to the latest version of WebRenderMartin Robinson2017-07-131-1/+1
|
* Bump serde to 1.0Bastien Orivel2017-06-161-3/+3
|
* Use NativeFontHandle instead of CGFontalfredoyang2017-04-211-2/+3
|
* Make ServoUrl::as_url return a &UrlAnthony Ramine2017-03-231-1/+1
|
* Update serde to 0.9 (fixes #15325)Anthony Ramine2017-02-181-3/+8
|
* gfx: Simplify OSX font template bytes accessor.Emilio Cobos Álvarez2016-12-251-3/+2
|
* Urlmageddon: Use refcounted urls more often.Emilio Cobos Álvarez2016-11-171-3/+3
|
* Update to string-cache 0.3Simon Sapin2016-11-031-1/+1
|
* Auto merge of #12076 - jdm:font-load, r=pcwaltonbors-servo2016-09-191-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make font template data load fallible Remove a TODO around dealing with a failed file operation. Can we write an automated test for this? I don't really know what font template data is, but this failure seems to be fontconfig-specific... --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #12037 - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12076) <!-- Reviewable:end -->
| * Make font template data load fallible. Fixes #12037.Josh Matthews2016-07-051-4/+4
| |
* | Reorder `use` statementsUK9922016-09-091-2/+1
|/
* gfx: Clamp the font size we supply to Core Text to 0.01pt.Patrick Walton2016-04-111-15/+26
| | | | | | | | | | Core Text treats a font size of 0.0 as 12.0, which is obviously not what we want. Improves Twitter. Improves Reddit /r/rust. Closes #10492.
* Bump serde to 0.7Anthony Ramine2016-03-171-2/+2
|
* Add WebRender integration to Servo.Glenn Watson2016-02-181-0/+36
| | | | | | | | WebRender is an experimental GPU accelerated rendering backend for Servo. The WebRender backend can be specified by running Servo with the -w option (otherwise the default rendering backend will be used). WebRender has many bugs, and missing features - but it is usable to browse most websites - please report any WebRender specific rendering bugs you encounter!
* Derive Debug on FontGroup and its componentsOlaf Buddenhagen2015-12-121-1/+2
|
* Update string_cache to 0.2.Alan Jeffrey2015-11-251-1/+1
| | | | | | | | | | | Updated string_cache, html5ever, xml5ever and selectors in Cargo.toml files and Cargo.lock. Removed references to string_cache_plugin. Import atom! and ns! from string_cache. Replaced ns!("") by ns!(). Replaced ns!(XML) and co by ns!(xml) and co. Replaced atom!(foo) by atom!("foo"). Replaced Atom::from_slice by Atom::from. Replaced atom.as_slice() by &*atom.
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-1/+0
| | | | This merges import blocks that were reported by tidy as unmerged.
* sort all usesJohann Tuffe2015-08-201-1/+1
|
* Fix existing syntactics nits.Josh Matthews2015-08-161-1/+1
|
* gfx: Fix Core Text font instantiation for Web fonts on Mac.Patrick Walton2015-08-041-16/+12
| | | | Fixes GitHub Octicons. A reftest has been added for this.
* gfx: Instantiate the `CTFont` corresponding to a Mac font on demand.Patrick Walton2015-07-311-6/+16
| | | | This avoids panics in multiprocess mode.
* gfx: Make display lists serializable using `serde`.Patrick Walton2015-07-151-2/+49
| | | | | | | | | This commit introduces the `serde` dependency, which we will use to serialize messages going between processes in multiprocess Servo. This also adds a new debugging flag, `-Z print-display-list-json`, allowing the output of display list serialization to be visualized. This will be useful for our experiments with alternate rasterizers.
* Use atoms for font template structures.Glenn Watson2015-07-131-4/+4
|
* Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8.Simon Sapin2015-05-051-1/+1
|
* Remove some as_slice calls.Ms2ger2015-04-241-2/+2
|
* Retain buffer for CGDataProviderCreateWithData. Fixes #5084.Connor Jennings2015-03-151-1/+3
| | | | | | | CGDataProviderCreateWithData just wraps the underlying buffer. The underlying buffer needs to be kept around until the data provider is freed. Adding the buffer to the FontTemplateData struct ensures it sticks around.
* Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.Josh Matthews2015-01-281-0/+3
|
* Move to to_owned rather than into_string.Ms2ger2015-01-201-1/+3
| | | | into_string has been removed from Rust.
* gfx: to_string() -> into_string()Manish Goregaokar2014-12-271-1/+1
|
* Replace almost "render" to "paint" words in gfx crate.Tetsuharu OHZEKI2014-12-081-1/+1
|
* Cargoify servoJack Moffitt2014-09-081-0/+40