diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-06-19 22:26:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-19 20:26:19 +0000 |
commit | cd2ab36759dc58acdeb2b8321c38b7345b524a63 (patch) | |
tree | 30b940ca93f61d937f719c214d66f22374c90b2f /components | |
parent | 9f8118abc7fd9aba49e422cf13b5243e3b582fdc (diff) | |
download | servo-cd2ab36759dc58acdeb2b8321c38b7345b524a63.tar.gz servo-cd2ab36759dc58acdeb2b8321c38b7345b524a63.zip |
Rename `gfx` to `fonts` (#32556)
This crate only takes care of fonts now as graphics related things are
split into other crates. In addition, this exposes data structures at
the top of the crate, hiding the implementation details and making it
simpler to import them.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'components')
-rw-r--r-- | components/canvas/Cargo.toml | 2 | ||||
-rw-r--r-- | components/canvas/canvas_data.rs | 4 | ||||
-rw-r--r-- | components/canvas/canvas_paint_thread.rs | 3 | ||||
-rw-r--r-- | components/compositing/Cargo.toml | 4 | ||||
-rw-r--r-- | components/constellation/Cargo.toml | 4 | ||||
-rw-r--r-- | components/constellation/constellation.rs | 2 | ||||
-rw-r--r-- | components/constellation/pipeline.rs | 2 | ||||
-rw-r--r-- | components/fonts/Cargo.toml (renamed from components/gfx/Cargo.toml) | 6 | ||||
-rw-r--r-- | components/fonts/font.rs (renamed from components/gfx/font.rs) | 7 | ||||
-rw-r--r-- | components/fonts/font_cache_thread.rs (renamed from components/gfx/font_cache_thread.rs) | 0 | ||||
-rw-r--r-- | components/fonts/font_context.rs (renamed from components/gfx/font_context.rs) | 2 | ||||
-rw-r--r-- | components/fonts/font_store.rs (renamed from components/gfx/font_store.rs) | 0 | ||||
-rw-r--r-- | components/fonts/font_template.rs (renamed from components/gfx/font_template.rs) | 0 | ||||
-rw-r--r-- | components/fonts/glyph.rs (renamed from components/gfx/text/glyph.rs) | 2 | ||||
-rw-r--r-- | components/fonts/lib.rs (renamed from components/gfx/text/mod.rs) | 31 | ||||
-rw-r--r-- | components/fonts/platform/freetype/android/font_list.rs (renamed from components/gfx/platform/freetype/android/font_list.rs) | 3 | ||||
-rw-r--r-- | components/fonts/platform/freetype/android/xml.rs (renamed from components/gfx/platform/freetype/android/xml.rs) | 0 | ||||
-rw-r--r-- | components/fonts/platform/freetype/font.rs (renamed from components/gfx/platform/freetype/font.rs) | 2 | ||||
-rw-r--r-- | components/fonts/platform/freetype/font_list.rs (renamed from components/gfx/platform/freetype/font_list.rs) | 2 | ||||
-rw-r--r-- | components/fonts/platform/freetype/library_handle.rs (renamed from components/gfx/platform/freetype/library_handle.rs) | 0 | ||||
-rw-r--r-- | components/fonts/platform/freetype/ohos/font_list.rs (renamed from components/gfx/platform/freetype/ohos/font_list.rs) | 3 | ||||
-rw-r--r-- | components/fonts/platform/macos/core_text_font_cache.rs (renamed from components/gfx/platform/macos/core_text_font_cache.rs) | 0 | ||||
-rw-r--r-- | components/fonts/platform/macos/font.rs (renamed from components/gfx/platform/macos/font.rs) | 10 | ||||
-rw-r--r-- | components/fonts/platform/macos/font_list.rs (renamed from components/gfx/platform/macos/font_list.rs) | 5 | ||||
-rw-r--r-- | components/fonts/platform/mod.rs (renamed from components/gfx/platform/mod.rs) | 2 | ||||
-rw-r--r-- | components/fonts/platform/windows/font.rs (renamed from components/gfx/platform/windows/font.rs) | 9 | ||||
-rw-r--r-- | components/fonts/platform/windows/font_list.rs (renamed from components/gfx/platform/windows/font_list.rs) | 5 | ||||
-rw-r--r-- | components/fonts/shaper.rs (renamed from components/gfx/text/shaping/harfbuzz.rs) | 15 | ||||
-rw-r--r-- | components/fonts/tests/font_context.rs (renamed from components/gfx/tests/font_context.rs) | 12 | ||||
-rw-r--r-- | components/fonts/tests/font_template.rs (renamed from components/gfx/tests/font_template.rs) | 6 | ||||
-rw-r--r-- | components/fonts/tests/support/CSSTest/LICENSE (renamed from components/gfx/tests/support/CSSTest/LICENSE) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/CSSTest/README (renamed from components/gfx/tests/support/CSSTest/README) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-ascii.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-ascii.ttf) | bin | 28208 -> 28208 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-basic-bold.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-basic-bold.ttf) | bin | 232344 -> 232344 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-basic-bolditalic.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-basic-bolditalic.ttf) | bin | 221620 -> 221620 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-basic-italic.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-basic-italic.ttf) | bin | 227600 -> 227600 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-basic-regular.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-basic-regular.ttf) | bin | 229636 -> 229636 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-fallback.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-fallback.ttf) | bin | 28424 -> 28424 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-familyname-bold.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-familyname-bold.ttf) | bin | 29424 -> 29424 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-familyname-funkyA.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-familyname-funkyA.ttf) | bin | 29452 -> 29452 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-familyname-funkyB.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-familyname-funkyB.ttf) | bin | 29372 -> 29372 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-familyname-funkyC.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-familyname-funkyC.ttf) | bin | 29336 -> 29336 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-familyname.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-familyname.ttf) | bin | 29208 -> 29208 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-verify.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-verify.ttf) | bin | 28564 -> 28564 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-100.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-100.ttf) | bin | 8364 -> 8364 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-1479-w1.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-1479-w1.ttf) | bin | 8628 -> 8628 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-1479-w4.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-1479-w4.ttf) | bin | 8524 -> 8524 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-1479-w7.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-1479-w7.ttf) | bin | 8524 -> 8524 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-1479-w9.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-1479-w9.ttf) | bin | 8524 -> 8524 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-15-w1.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-15-w1.ttf) | bin | 8592 -> 8592 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-15-w5.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-15-w5.ttf) | bin | 8496 -> 8496 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-200.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-200.ttf) | bin | 8364 -> 8364 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-24-w2.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-24-w2.ttf) | bin | 8496 -> 8496 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-24-w4.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-24-w4.ttf) | bin | 8496 -> 8496 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-2569-w2.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-2569-w2.ttf) | bin | 8524 -> 8524 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-2569-w5.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-2569-w5.ttf) | bin | 8524 -> 8524 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-2569-w6.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-2569-w6.ttf) | bin | 8524 -> 8524 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-2569-w9.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-2569-w9.ttf) | bin | 8524 -> 8524 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-258-w2.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-258-w2.ttf) | bin | 8508 -> 8508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-258-w5.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-258-w5.ttf) | bin | 8508 -> 8508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-258-w8.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-258-w8.ttf) | bin | 8508 -> 8508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-300.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-300.ttf) | bin | 8364 -> 8364 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-3589-w3.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-3589-w3.ttf) | bin | 8524 -> 8524 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-3589-w5.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-3589-w5.ttf) | bin | 8524 -> 8524 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-3589-w8.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-3589-w8.ttf) | bin | 8524 -> 8524 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-3589-w9.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-3589-w9.ttf) | bin | 8524 -> 8524 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-400.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-400.ttf) | bin | 8364 -> 8364 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-47-w4.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-47-w4.ttf) | bin | 8496 -> 8496 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-47-w7.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-47-w7.ttf) | bin | 8496 -> 8496 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-500.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-500.ttf) | bin | 8364 -> 8364 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-600.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-600.ttf) | bin | 8364 -> 8364 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-700.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-700.ttf) | bin | 8364 -> 8364 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-800.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-800.ttf) | bin | 8364 -> 8364 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-900.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-900.ttf) | bin | 8364 -> 8364 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-full-w1.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-full-w1.ttf) | bin | 8608 -> 8608 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-full-w2.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-full-w2.ttf) | bin | 8508 -> 8508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-full-w3.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-full-w3.ttf) | bin | 8508 -> 8508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-full-w4.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-full-w4.ttf) | bin | 8508 -> 8508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-full-w5.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-full-w5.ttf) | bin | 8508 -> 8508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-full-w6.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-full-w6.ttf) | bin | 8508 -> 8508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-full-w7.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-full-w7.ttf) | bin | 8508 -> 8508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-full-w8.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-full-w8.ttf) | bin | 8508 -> 8508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights-full-w9.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights-full-w9.ttf) | bin | 8508 -> 8508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/CSSTest/csstest-weights.ttf (renamed from components/gfx/tests/support/CSSTest/csstest-weights.ttf) | bin | 8320 -> 8320 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/AUTHORS (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/AUTHORS) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/BUGS (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/BUGS) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/LICENSE (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/LICENSE) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/NEWS (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/NEWS) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/README.md (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/README.md) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans-mono.conf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans-mono.conf) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans.conf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans.conf) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-serif.conf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-serif.conf) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans-mono.conf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans-mono.conf) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans.conf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans.conf) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-serif.conf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-serif.conf) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/langcover.txt (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/langcover.txt) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/status.txt (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/status.txt) | 0 | ||||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuMathTeXGyre.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuMathTeXGyre.ttf) | bin | 577708 -> 577708 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Bold.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Bold.ttf) | bin | 705684 -> 705684 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-BoldOblique.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-BoldOblique.ttf) | bin | 643292 -> 643292 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-ExtraLight.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-ExtraLight.ttf) | bin | 355380 -> 355380 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Oblique.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Oblique.ttf) | bin | 635416 -> 635416 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf) | bin | 757076 -> 757076 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Bold.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Bold.ttf) | bin | 665028 -> 665028 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-BoldOblique.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-BoldOblique.ttf) | bin | 611836 -> 611836 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Oblique.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Oblique.ttf) | bin | 599292 -> 599292 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed.ttf) | bin | 680264 -> 680264 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Bold.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Bold.ttf) | bin | 331992 -> 331992 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-BoldOblique.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-BoldOblique.ttf) | bin | 253580 -> 253580 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Oblique.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Oblique.ttf) | bin | 251932 -> 251932 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf) | bin | 340712 -> 340712 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Bold.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Bold.ttf) | bin | 356088 -> 356088 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-BoldItalic.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-BoldItalic.ttf) | bin | 347460 -> 347460 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Italic.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Italic.ttf) | bin | 345996 -> 345996 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif.ttf) | bin | 380132 -> 380132 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Bold.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Bold.ttf) | bin | 331244 -> 331244 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-BoldItalic.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-BoldItalic.ttf) | bin | 346508 -> 346508 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Italic.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Italic.ttf) | bin | 345324 -> 345324 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed.ttf (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed.ttf) | bin | 346664 -> 346664 bytes | |||
-rw-r--r-- | components/fonts/tests/support/dejavu-fonts-ttf-2.37/unicover.txt (renamed from components/gfx/tests/support/dejavu-fonts-ttf-2.37/unicover.txt) | 0 | ||||
-rw-r--r-- | components/gfx/lib.rs | 14 | ||||
-rw-r--r-- | components/gfx/text/shaping/mod.rs | 18 | ||||
-rw-r--r-- | components/gfx/text/util.rs | 11 | ||||
-rw-r--r-- | components/layout/Cargo.toml | 4 | ||||
-rw-r--r-- | components/layout/context.rs | 3 | ||||
-rw-r--r-- | components/layout/display_list/builder.rs | 2 | ||||
-rw-r--r-- | components/layout/fragment.rs | 2 | ||||
-rw-r--r-- | components/layout/inline.rs | 2 | ||||
-rw-r--r-- | components/layout/text.rs | 9 | ||||
-rw-r--r-- | components/layout/text_run.rs | 5 | ||||
-rw-r--r-- | components/layout_2020/Cargo.toml | 4 | ||||
-rw-r--r-- | components/layout_2020/context.rs | 3 | ||||
-rw-r--r-- | components/layout_2020/display_list/mod.rs | 4 | ||||
-rw-r--r-- | components/layout_2020/flow/inline/line.rs | 3 | ||||
-rw-r--r-- | components/layout_2020/flow/inline/mod.rs | 3 | ||||
-rw-r--r-- | components/layout_2020/flow/inline/text_run.rs | 12 | ||||
-rw-r--r-- | components/layout_2020/fragment_tree/fragment.rs | 3 | ||||
-rw-r--r-- | components/layout_thread/Cargo.toml | 4 | ||||
-rw-r--r-- | components/layout_thread/lib.rs | 12 | ||||
-rw-r--r-- | components/layout_thread_2020/Cargo.toml | 4 | ||||
-rw-r--r-- | components/layout_thread_2020/lib.rs | 5 | ||||
-rw-r--r-- | components/metrics/Cargo.toml | 2 | ||||
-rw-r--r-- | components/script/Cargo.toml | 4 | ||||
-rw-r--r-- | components/script/layout_dom/node.rs | 2 | ||||
-rw-r--r-- | components/script/script_thread.rs | 2 | ||||
-rw-r--r-- | components/servo/Cargo.toml | 4 | ||||
-rw-r--r-- | components/servo/lib.rs | 4 | ||||
-rw-r--r-- | components/shared/compositing/Cargo.toml | 2 | ||||
-rw-r--r-- | components/shared/fonts/Cargo.toml (renamed from components/shared/gfx/Cargo.toml) | 4 | ||||
-rw-r--r-- | components/shared/fonts/lib.rs (renamed from components/shared/gfx/lib.rs) | 0 | ||||
-rw-r--r-- | components/shared/script/Cargo.toml | 2 | ||||
-rw-r--r-- | components/shared/script_layout/Cargo.toml | 4 | ||||
-rw-r--r-- | components/shared/script_layout/lib.rs | 2 | ||||
-rw-r--r-- | components/shared/script_layout/wrapper_traits.rs | 2 |
154 files changed, 131 insertions, 173 deletions
diff --git a/components/canvas/Cargo.toml b/components/canvas/Cargo.toml index a0d2e41ffb5..c54b814323c 100644 --- a/components/canvas/Cargo.toml +++ b/components/canvas/Cargo.toml @@ -24,7 +24,7 @@ cssparser = { workspace = true } euclid = { workspace = true } font-kit = { version = "0.13" } fnv = { workspace = true } -gfx = { path = "../gfx" } +fonts = { path = "../fonts" } half = "2" ipc-channel = { workspace = true } log = { workspace = true } diff --git a/components/canvas/canvas_data.rs b/components/canvas/canvas_data.rs index 5396eaddea6..b7d878ef35f 100644 --- a/components/canvas/canvas_data.rs +++ b/components/canvas/canvas_data.rs @@ -13,9 +13,7 @@ use font_kit::font::Font; use font_kit::metrics::Metrics; use font_kit::properties::{Properties, Stretch, Style, Weight}; use font_kit::source::SystemSource; -use gfx::font_cache_thread::FontCacheThread; -use gfx::font_context::FontContext; -use gfx::font_template::FontTemplateRefMethods; +use fonts::{FontCacheThread, FontContext, FontTemplateRefMethods}; use ipc_channel::ipc::{IpcSender, IpcSharedMemory}; use log::{debug, error, warn}; use num_traits::ToPrimitive; diff --git a/components/canvas/canvas_paint_thread.rs b/components/canvas/canvas_paint_thread.rs index 2ace98e9f1f..d4d2bb877c7 100644 --- a/components/canvas/canvas_paint_thread.rs +++ b/components/canvas/canvas_paint_thread.rs @@ -11,8 +11,7 @@ use canvas_traits::canvas::*; use canvas_traits::ConstellationCanvasMsg; use crossbeam_channel::{select, unbounded, Sender}; use euclid::default::Size2D; -use gfx::font_cache_thread::FontCacheThread; -use gfx::font_context::FontContext; +use fonts::{FontCacheThread, FontContext}; use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::router::ROUTER; use log::warn; diff --git a/components/compositing/Cargo.toml b/components/compositing/Cargo.toml index c5004e9b26d..52e2932104c 100644 --- a/components/compositing/Cargo.toml +++ b/components/compositing/Cargo.toml @@ -23,8 +23,8 @@ crossbeam-channel = { workspace = true } embedder_traits = { workspace = true } euclid = { workspace = true } fnv = { workspace = true } -gfx = { path = "../gfx" } -gfx_traits = { workspace = true } +fonts = { path = "../fonts" } +fonts_traits = { workspace = true } gleam = { workspace = true } image = { workspace = true } ipc-channel = { workspace = true } diff --git a/components/constellation/Cargo.toml b/components/constellation/Cargo.toml index edcf2293844..4d221d95f28 100644 --- a/components/constellation/Cargo.toml +++ b/components/constellation/Cargo.toml @@ -26,8 +26,8 @@ crossbeam-channel = { workspace = true } devtools_traits = { workspace = true } embedder_traits = { workspace = true } euclid = { workspace = true } -gfx = { path = "../gfx" } -gfx_traits = { workspace = true } +fonts = { path = "../fonts" } +fonts_traits = { workspace = true } http = { workspace = true } ipc-channel = { workspace = true } keyboard-types = { workspace = true } diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 36e6a190c5b..1889b9df250 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -121,7 +121,7 @@ use embedder_traits::{ }; use euclid::default::Size2D as UntypedSize2D; use euclid::Size2D; -use gfx::font_cache_thread::FontCacheThread; +use fonts::FontCacheThread; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use ipc_channel::Error as IpcError; diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index 9547aa8a354..b79609dc3a8 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -22,7 +22,7 @@ use compositing_traits::{CompositionPipeline, CompositorMsg, CompositorProxy}; use crossbeam_channel::{unbounded, Sender}; use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg}; use embedder_traits::EventLoopWaker; -use gfx::font_cache_thread::FontCacheThread; +use fonts::FontCacheThread; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use ipc_channel::Error; diff --git a/components/gfx/Cargo.toml b/components/fonts/Cargo.toml index 879fcbb29be..e8a165c0524 100644 --- a/components/gfx/Cargo.toml +++ b/components/fonts/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "gfx" +name = "fonts" version.workspace = true authors.workspace = true license.workspace = true @@ -7,7 +7,7 @@ edition.workspace = true publish.workspace = true [lib] -name = "gfx" +name = "fonts" path = "lib.rs" test = false doctest = false @@ -22,7 +22,7 @@ crossbeam-channel = { workspace = true } euclid = { workspace = true } fnv = { workspace = true } fontsan = { git = "https://github.com/servo/fontsan" } -gfx_traits = { workspace = true } +fonts_traits = { workspace = true } harfbuzz-sys = "0.6.1" ipc-channel = { workspace = true } lazy_static = { workspace = true } diff --git a/components/gfx/font.rs b/components/fonts/font.rs index ef93af1170e..14f5af4197e 100644 --- a/components/gfx/font.rs +++ b/components/fonts/font.rs @@ -30,9 +30,10 @@ use crate::font_context::FontContext; use crate::font_template::{FontTemplateDescriptor, FontTemplateRef, FontTemplateRefMethods}; use crate::platform::font::{FontTable, PlatformFont}; pub use crate::platform::font_list::fallback_font_families; -use crate::text::glyph::{ByteIndex, GlyphData, GlyphId, GlyphStore}; -use crate::text::shaping::ShaperMethods; -use crate::text::{EmojiPresentationPreference, FallbackFontSelectionOptions, Shaper}; +use crate::{ + ByteIndex, EmojiPresentationPreference, FallbackFontSelectionOptions, GlyphData, GlyphId, + GlyphStore, Shaper, +}; #[macro_export] macro_rules! ot_tag { diff --git a/components/gfx/font_cache_thread.rs b/components/fonts/font_cache_thread.rs index bde22d4b515..bde22d4b515 100644 --- a/components/gfx/font_cache_thread.rs +++ b/components/fonts/font_cache_thread.rs diff --git a/components/gfx/font_context.rs b/components/fonts/font_context.rs index 124a21f6e37..a28621469d6 100644 --- a/components/gfx/font_context.rs +++ b/components/fonts/font_context.rs @@ -11,7 +11,7 @@ use std::sync::Arc; use app_units::Au; use crossbeam_channel::unbounded; use fnv::FnvHasher; -use gfx_traits::WebFontLoadFinishedCallback; +use fonts_traits::WebFontLoadFinishedCallback; use log::{debug, trace}; use malloc_size_of::{MallocSizeOf, MallocSizeOfOps}; use malloc_size_of_derive::MallocSizeOf; diff --git a/components/gfx/font_store.rs b/components/fonts/font_store.rs index ff6d56abac2..ff6d56abac2 100644 --- a/components/gfx/font_store.rs +++ b/components/fonts/font_store.rs diff --git a/components/gfx/font_template.rs b/components/fonts/font_template.rs index 19c71ed83fa..19c71ed83fa 100644 --- a/components/gfx/font_template.rs +++ b/components/fonts/font_template.rs diff --git a/components/gfx/text/glyph.rs b/components/fonts/glyph.rs index fd608e7ebaa..420d43b0774 100644 --- a/components/gfx/text/glyph.rs +++ b/components/fonts/glyph.rs @@ -9,7 +9,7 @@ use std::{fmt, mem, u16}; use app_units::Au; use euclid::default::Point2D; -pub use gfx_traits::ByteIndex; +pub use fonts_traits::ByteIndex; use log::debug; use malloc_size_of_derive::MallocSizeOf; use range::{self, EachIndex, Range, RangeIndex}; diff --git a/components/gfx/text/mod.rs b/components/fonts/lib.rs index 9a44f743c7a..305db5e53ef 100644 --- a/components/gfx/text/mod.rs +++ b/components/fonts/lib.rs @@ -2,13 +2,26 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -use unicode_properties::{emoji, EmojiStatus, UnicodeEmoji}; +#![deny(unsafe_code)] -pub use crate::text::shaping::Shaper; +mod font; +mod font_cache_thread; +mod font_context; +mod font_store; +mod font_template; +mod glyph; +#[allow(unsafe_code)] +pub mod platform; +mod shaper; -pub mod glyph; -pub mod shaping; -pub mod util; +pub use font::*; +pub use font_cache_thread::*; +pub use font_context::*; +pub use font_store::*; +pub use font_template::*; +pub use glyph::*; +pub use shaper::*; +use unicode_properties::{emoji, EmojiStatus, UnicodeEmoji}; /// Whether or not font fallback selection prefers the emoji or text representation /// of a character. If `None` then either presentation is acceptable. @@ -66,3 +79,11 @@ impl FallbackFontSelectionOptions { } } } + +pub(crate) fn float_to_fixed(before: usize, f: f64) -> i32 { + ((1i32 << before) as f64 * f) as i32 +} + +pub(crate) fn fixed_to_float(before: usize, f: i32) -> f64 { + f as f64 * 1.0f64 / ((1i32 << before) as f64) +} diff --git a/components/gfx/platform/freetype/android/font_list.rs b/components/fonts/platform/freetype/android/font_list.rs index dc466690a94..3343c7c3788 100644 --- a/components/gfx/platform/freetype/android/font_list.rs +++ b/components/fonts/platform/freetype/android/font_list.rs @@ -16,8 +16,7 @@ use style::values::computed::{ use style::Atom; use super::xml::{Attribute, Node}; -use crate::font_template::{FontTemplate, FontTemplateDescriptor}; -use crate::text::FallbackFontSelectionOptions; +use crate::{FallbackFontSelectionOptions, FontTemplate, FontTemplateDescriptor}; lazy_static::lazy_static! { static ref FONT_LIST: FontList = FontList::new(); diff --git a/components/gfx/platform/freetype/android/xml.rs b/components/fonts/platform/freetype/android/xml.rs index 42a21a05829..42a21a05829 100644 --- a/components/gfx/platform/freetype/android/xml.rs +++ b/components/fonts/platform/freetype/android/xml.rs diff --git a/components/gfx/platform/freetype/font.rs b/components/fonts/platform/freetype/font.rs index 1fa1a07fc3d..f3872298133 100644 --- a/components/gfx/platform/freetype/font.rs +++ b/components/fonts/platform/freetype/font.rs @@ -31,7 +31,7 @@ use crate::font::{ }; use crate::font_cache_thread::FontIdentifier; use crate::font_template::FontTemplateDescriptor; -use crate::text::glyph::GlyphId; +use crate::glyph::GlyphId; // This constant is not present in the freetype // bindings due to bindgen not handling the way diff --git a/components/gfx/platform/freetype/font_list.rs b/components/fonts/platform/freetype/font_list.rs index 73d17ccd49e..95e4b4043d2 100644 --- a/components/gfx/platform/freetype/font_list.rs +++ b/components/fonts/platform/freetype/font_list.rs @@ -35,7 +35,7 @@ use super::c_str_to_string; use crate::font::map_platform_values_to_style_values; use crate::font_template::{FontTemplate, FontTemplateDescriptor}; use crate::platform::add_noto_fallback_families; -use crate::text::{EmojiPresentationPreference, FallbackFontSelectionOptions}; +use crate::{EmojiPresentationPreference, FallbackFontSelectionOptions}; /// An identifier for a local font on systems using Freetype. #[derive(Clone, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize)] diff --git a/components/gfx/platform/freetype/library_handle.rs b/components/fonts/platform/freetype/library_handle.rs index 13a7ee2389f..13a7ee2389f 100644 --- a/components/gfx/platform/freetype/library_handle.rs +++ b/components/fonts/platform/freetype/library_handle.rs diff --git a/components/gfx/platform/freetype/ohos/font_list.rs b/components/fonts/platform/freetype/ohos/font_list.rs index a1717629ad5..75eef136189 100644 --- a/components/gfx/platform/freetype/ohos/font_list.rs +++ b/components/fonts/platform/freetype/ohos/font_list.rs @@ -15,8 +15,7 @@ use style::values::computed::{ }; use style::Atom; -use crate::font_template::{FontTemplate, FontTemplateDescriptor}; -use crate::text::FallbackFontSelectionOptions; +use crate::{FallbackFontSelectionOptions, FontTemplate, FontTemplateDescriptor}; lazy_static::lazy_static! { static ref FONT_LIST: FontList = FontList::new(); diff --git a/components/gfx/platform/macos/core_text_font_cache.rs b/components/fonts/platform/macos/core_text_font_cache.rs index bd59550d45e..bd59550d45e 100644 --- a/components/gfx/platform/macos/core_text_font_cache.rs +++ b/components/fonts/platform/macos/core_text_font_cache.rs diff --git a/components/gfx/platform/macos/font.rs b/components/fonts/platform/macos/font.rs index 0e4617a8360..437950fbf4d 100644 --- a/components/gfx/platform/macos/font.rs +++ b/components/fonts/platform/macos/font.rs @@ -22,13 +22,11 @@ use style::values::computed::font::{FontStretch, FontStyle, FontWeight}; use webrender_api::FontInstanceFlags; use super::core_text_font_cache::CoreTextFontCache; -use crate::font::{ - map_platform_values_to_style_values, FontMetrics, FontTableMethods, FontTableTag, - FractionalPixel, PlatformFontMethods, CBDT, COLR, GPOS, GSUB, KERN, SBIX, +use crate::{ + map_platform_values_to_style_values, FontIdentifier, FontMetrics, FontTableMethods, + FontTableTag, FontTemplateDescriptor, FractionalPixel, GlyphId, PlatformFontMethods, CBDT, + COLR, GPOS, GSUB, KERN, SBIX, }; -use crate::font_cache_thread::FontIdentifier; -use crate::font_template::FontTemplateDescriptor; -use crate::text::glyph::GlyphId; const KERN_PAIR_LEN: usize = 6; diff --git a/components/gfx/platform/macos/font_list.rs b/components/fonts/platform/macos/font_list.rs index c1d9621f61e..b2176b31f42 100644 --- a/components/gfx/platform/macos/font_list.rs +++ b/components/fonts/platform/macos/font_list.rs @@ -14,10 +14,11 @@ use style::Atom; use unicode_script::Script; use webrender_api::NativeFontHandle; -use crate::font_template::{FontTemplate, FontTemplateDescriptor}; use crate::platform::add_noto_fallback_families; use crate::platform::font::CoreTextFontTraitsMapping; -use crate::text::{EmojiPresentationPreference, FallbackFontSelectionOptions}; +use crate::{ + EmojiPresentationPreference, FallbackFontSelectionOptions, FontTemplate, FontTemplateDescriptor, +}; /// An identifier for a local font on a MacOS system. These values comes from the CoreText /// CTFontCollection. Note that `path` here is required. We do not load fonts that do not diff --git a/components/gfx/platform/mod.rs b/components/fonts/platform/mod.rs index 542c6ab0aed..6aebc107f66 100644 --- a/components/gfx/platform/mod.rs +++ b/components/fonts/platform/mod.rs @@ -14,7 +14,7 @@ pub use crate::platform::macos::{core_text_font_cache, font, font_list}; #[cfg(target_os = "windows")] pub use crate::platform::windows::{font, font_list}; #[cfg(any(target_os = "linux", target_os = "macos"))] -use crate::text::FallbackFontSelectionOptions; +use crate::FallbackFontSelectionOptions; #[cfg(any(target_os = "linux", target_os = "android"))] mod freetype { diff --git a/components/gfx/platform/windows/font.rs b/components/fonts/platform/windows/font.rs index 4aeb04fc29f..8dd2d78bb1f 100644 --- a/components/gfx/platform/windows/font.rs +++ b/components/fonts/platform/windows/font.rs @@ -22,13 +22,10 @@ use truetype::tables::WindowsMetrics; use truetype::value::Read; use webrender_api::FontInstanceFlags; -use crate::font::{ - FontMetrics, FontTableMethods, FontTableTag, FractionalPixel, PlatformFontMethods, +use crate::{ + ot_tag, FontIdentifier, FontMetrics, FontTableMethods, FontTableTag, FontTemplateDescriptor, + FractionalPixel, GlyphId, PlatformFontMethods, }; -use crate::font_cache_thread::FontIdentifier; -use crate::font_template::FontTemplateDescriptor; -use crate::ot_tag; -use crate::text::glyph::GlyphId; // 1em = 12pt = 16px, assuming 72 points per inch and 96 px per inch fn pt_to_px(pt: f64) -> f64 { diff --git a/components/gfx/platform/windows/font_list.rs b/components/fonts/platform/windows/font_list.rs index 9ac7011e270..31c1d631160 100644 --- a/components/gfx/platform/windows/font_list.rs +++ b/components/fonts/platform/windows/font_list.rs @@ -12,8 +12,9 @@ use serde::{Deserialize, Serialize}; use style::values::computed::{FontStyle as StyleFontStyle, FontWeight as StyleFontWeight}; use style::values::specified::font::FontStretchKeyword; -use crate::font_template::{FontTemplate, FontTemplateDescriptor}; -use crate::text::{EmojiPresentationPreference, FallbackFontSelectionOptions}; +use crate::{ + EmojiPresentationPreference, FallbackFontSelectionOptions, FontTemplate, FontTemplateDescriptor, +}; pub static SANS_SERIF_FONT_FAMILY: &str = "Arial"; diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/fonts/shaper.rs index ddf085054ea..72d47de28fb 100644 --- a/components/gfx/text/shaping/harfbuzz.rs +++ b/components/fonts/shaper.rs @@ -25,12 +25,11 @@ use harfbuzz_sys::{ use lazy_static::lazy_static; use log::debug; -use crate::font::{Font, FontTableMethods, FontTableTag, ShapingFlags, ShapingOptions, KERN}; -use crate::ot_tag; use crate::platform::font::FontTable; -use crate::text::glyph::{ByteIndex, GlyphData, GlyphId, GlyphStore}; -use crate::text::shaping::ShaperMethods; -use crate::text::util::{fixed_to_float, float_to_fixed}; +use crate::{ + fixed_to_float, float_to_fixed, ot_tag, ByteIndex, Font, FontTableMethods, FontTableTag, + GlyphData, GlyphId, GlyphStore, ShapingFlags, ShapingOptions, KERN, +}; const NO_GLYPH: i32 = -1; const LIGA: u32 = ot_tag!('l', 'i', 'g', 'a'); @@ -361,10 +360,10 @@ pub fn unicode_to_hb_script(script: unicode_script::Script) -> harfbuzz_sys::hb_ } } -impl ShaperMethods for Shaper { +impl Shaper { /// Calculate the layout metrics associated with the given text when painted in a specific /// font. - fn shape_text(&self, text: &str, options: &ShapingOptions, glyphs: &mut GlyphStore) { + pub(crate) fn shape_text(&self, text: &str, options: &ShapingOptions, glyphs: &mut GlyphStore) { unsafe { let hb_buffer: *mut hb_buffer_t = hb_buffer_create(); hb_buffer_set_direction( @@ -420,9 +419,7 @@ impl ShaperMethods for Shaper { hb_buffer_destroy(hb_buffer); } } -} -impl Shaper { fn save_glyph_results( &self, text: &str, diff --git a/components/gfx/tests/font_context.rs b/components/fonts/tests/font_context.rs index 85f3159bbd5..652760d7f33 100644 --- a/components/gfx/tests/font_context.rs +++ b/components/fonts/tests/font_context.rs @@ -10,14 +10,11 @@ use std::path::PathBuf; use std::rc::Rc; use app_units::Au; -use gfx::font::{ - fallback_font_families, FontDescriptor, FontFamilyDescriptor, FontFamilyName, FontSearchScope, +use fonts::{ + fallback_font_families, CSSFontFaceDescriptors, FallbackFontSelectionOptions, FontContext, + FontDescriptor, FontFamilyDescriptor, FontFamilyName, FontIdentifier, FontSearchScope, + FontSource, FontTemplate, FontTemplateRef, FontTemplates, }; -use gfx::font_cache_thread::{CSSFontFaceDescriptors, FontIdentifier, FontSource}; -use gfx::font_context::FontContext; -use gfx::font_store::FontTemplates; -use gfx::font_template::{FontTemplate, FontTemplateRef}; -use gfx::text::FallbackFontSelectionOptions; use ipc_channel::ipc; use net_traits::ResourceThreads; use servo_arc::Arc; @@ -25,7 +22,6 @@ use servo_atoms::Atom; use servo_url::ServoUrl; use style::properties::longhands::font_variant_caps::computed_value::T as FontVariantCaps; use style::properties::style_structs::Font as FontStyleStruct; -use style::stylesheets::Stylesheet; use style::values::computed::font::{ FamilyName, FontFamily, FontFamilyList, FontFamilyNameSyntax, FontSize, FontStretch, FontStyle, FontWeight, SingleFontFamily, diff --git a/components/gfx/tests/font_template.rs b/components/fonts/tests/font_template.rs index 8ae6caf7a62..75290708cc9 100644 --- a/components/gfx/tests/font_template.rs +++ b/components/fonts/tests/font_template.rs @@ -11,10 +11,8 @@ fn test_font_template_descriptor() { use std::path::PathBuf; use std::sync::Arc; - use gfx::font::PlatformFontMethods; - use gfx::font_cache_thread::FontIdentifier; - use gfx::font_template::FontTemplateDescriptor; - use gfx::platform::font::PlatformFont; + use fonts::platform::font::PlatformFont; + use fonts::{FontIdentifier, FontTemplateDescriptor, PlatformFontMethods}; use servo_url::ServoUrl; use style::values::computed::font::{FontStretch, FontStyle, FontWeight}; diff --git a/components/gfx/tests/support/CSSTest/LICENSE b/components/fonts/tests/support/CSSTest/LICENSE index 9b3c1a6df54..9b3c1a6df54 100644 --- a/components/gfx/tests/support/CSSTest/LICENSE +++ b/components/fonts/tests/support/CSSTest/LICENSE diff --git a/components/gfx/tests/support/CSSTest/README b/components/fonts/tests/support/CSSTest/README index d4fe8fb50ae..d4fe8fb50ae 100644 --- a/components/gfx/tests/support/CSSTest/README +++ b/components/fonts/tests/support/CSSTest/README diff --git a/components/gfx/tests/support/CSSTest/csstest-ascii.ttf b/components/fonts/tests/support/CSSTest/csstest-ascii.ttf Binary files differindex 076788e9ce3..076788e9ce3 100644 --- a/components/gfx/tests/support/CSSTest/csstest-ascii.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-ascii.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-basic-bold.ttf b/components/fonts/tests/support/CSSTest/csstest-basic-bold.ttf Binary files differindex 8c53e6fdd42..8c53e6fdd42 100644 --- a/components/gfx/tests/support/CSSTest/csstest-basic-bold.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-basic-bold.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-basic-bolditalic.ttf b/components/fonts/tests/support/CSSTest/csstest-basic-bolditalic.ttf Binary files differindex 5b58f1ffa24..5b58f1ffa24 100644 --- a/components/gfx/tests/support/CSSTest/csstest-basic-bolditalic.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-basic-bolditalic.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-basic-italic.ttf b/components/fonts/tests/support/CSSTest/csstest-basic-italic.ttf Binary files differindex 10926ce4e11..10926ce4e11 100644 --- a/components/gfx/tests/support/CSSTest/csstest-basic-italic.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-basic-italic.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-basic-regular.ttf b/components/fonts/tests/support/CSSTest/csstest-basic-regular.ttf Binary files differindex c98d6130b68..c98d6130b68 100644 --- a/components/gfx/tests/support/CSSTest/csstest-basic-regular.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-basic-regular.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-fallback.ttf b/components/fonts/tests/support/CSSTest/csstest-fallback.ttf Binary files differindex 4f20f261f4d..4f20f261f4d 100644 --- a/components/gfx/tests/support/CSSTest/csstest-fallback.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-fallback.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-familyname-bold.ttf b/components/fonts/tests/support/CSSTest/csstest-familyname-bold.ttf Binary files differindex 4bddbc2d16f..4bddbc2d16f 100644 --- a/components/gfx/tests/support/CSSTest/csstest-familyname-bold.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-familyname-bold.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-familyname-funkyA.ttf b/components/fonts/tests/support/CSSTest/csstest-familyname-funkyA.ttf Binary files differindex 9f605f9190f..9f605f9190f 100644 --- a/components/gfx/tests/support/CSSTest/csstest-familyname-funkyA.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-familyname-funkyA.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-familyname-funkyB.ttf b/components/fonts/tests/support/CSSTest/csstest-familyname-funkyB.ttf Binary files differindex 0a3688c53ab..0a3688c53ab 100644 --- a/components/gfx/tests/support/CSSTest/csstest-familyname-funkyB.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-familyname-funkyB.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-familyname-funkyC.ttf b/components/fonts/tests/support/CSSTest/csstest-familyname-funkyC.ttf Binary files differindex feb463b15d9..feb463b15d9 100644 --- a/components/gfx/tests/support/CSSTest/csstest-familyname-funkyC.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-familyname-funkyC.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-familyname.ttf b/components/fonts/tests/support/CSSTest/csstest-familyname.ttf Binary files differindex 5131280c2fe..5131280c2fe 100644 --- a/components/gfx/tests/support/CSSTest/csstest-familyname.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-familyname.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-verify.ttf b/components/fonts/tests/support/CSSTest/csstest-verify.ttf Binary files differindex 1d0b62a200b..1d0b62a200b 100644 --- a/components/gfx/tests/support/CSSTest/csstest-verify.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-verify.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-100.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-100.ttf Binary files differindex 964558a9499..964558a9499 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-100.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-100.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-1479-w1.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-1479-w1.ttf Binary files differindex 181d1a70e1d..181d1a70e1d 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-1479-w1.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-1479-w1.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-1479-w4.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-1479-w4.ttf Binary files differindex 1751716d7a3..1751716d7a3 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-1479-w4.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-1479-w4.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-1479-w7.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-1479-w7.ttf Binary files differindex f38fca9ff20..f38fca9ff20 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-1479-w7.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-1479-w7.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-1479-w9.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-1479-w9.ttf Binary files differindex 7f34bbff829..7f34bbff829 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-1479-w9.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-1479-w9.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-15-w1.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-15-w1.ttf Binary files differindex 851f29b9f0b..851f29b9f0b 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-15-w1.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-15-w1.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-15-w5.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-15-w5.ttf Binary files differindex cb06f50f905..cb06f50f905 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-15-w5.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-15-w5.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-200.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-200.ttf Binary files differindex 306d8954986..306d8954986 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-200.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-200.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-24-w2.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-24-w2.ttf Binary files differindex 4c8533e658d..4c8533e658d 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-24-w2.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-24-w2.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-24-w4.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-24-w4.ttf Binary files differindex 63cecb9aa30..63cecb9aa30 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-24-w4.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-24-w4.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-2569-w2.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-2569-w2.ttf Binary files differindex 99e03e90e67..99e03e90e67 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-2569-w2.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-2569-w2.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-2569-w5.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-2569-w5.ttf Binary files differindex 9300aeef4c1..9300aeef4c1 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-2569-w5.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-2569-w5.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-2569-w6.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-2569-w6.ttf Binary files differindex 546489031e2..546489031e2 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-2569-w6.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-2569-w6.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-2569-w9.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-2569-w9.ttf Binary files differindex 66a1a06015c..66a1a06015c 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-2569-w9.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-2569-w9.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-258-w2.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-258-w2.ttf Binary files differindex 95b048816cf..95b048816cf 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-258-w2.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-258-w2.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-258-w5.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-258-w5.ttf Binary files differindex 3de6631d0bc..3de6631d0bc 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-258-w5.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-258-w5.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-258-w8.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-258-w8.ttf Binary files differindex 25d64dfb8c1..25d64dfb8c1 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-258-w8.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-258-w8.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-300.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-300.ttf Binary files differindex 87fcd310aee..87fcd310aee 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-300.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-300.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-3589-w3.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-3589-w3.ttf Binary files differindex fb071c03dfe..fb071c03dfe 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-3589-w3.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-3589-w3.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-3589-w5.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-3589-w5.ttf Binary files differindex 2b9e530a816..2b9e530a816 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-3589-w5.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-3589-w5.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-3589-w8.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-3589-w8.ttf Binary files differindex 745a60ae25f..745a60ae25f 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-3589-w8.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-3589-w8.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-3589-w9.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-3589-w9.ttf Binary files differindex e805f01d8fd..e805f01d8fd 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-3589-w9.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-3589-w9.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-400.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-400.ttf Binary files differindex 9938a378bd6..9938a378bd6 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-400.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-400.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-47-w4.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-47-w4.ttf Binary files differindex f6108ab2100..f6108ab2100 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-47-w4.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-47-w4.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-47-w7.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-47-w7.ttf Binary files differindex 9496c5fdf27..9496c5fdf27 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-47-w7.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-47-w7.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-500.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-500.ttf Binary files differindex 0c132d28cdb..0c132d28cdb 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-500.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-500.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-600.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-600.ttf Binary files differindex ce776c01a2d..ce776c01a2d 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-600.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-600.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-700.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-700.ttf Binary files differindex 156b0287a98..156b0287a98 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-700.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-700.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-800.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-800.ttf Binary files differindex 0f41c304677..0f41c304677 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-800.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-800.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-900.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-900.ttf Binary files differindex 97c8735125b..97c8735125b 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-900.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-900.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-full-w1.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-full-w1.ttf Binary files differindex dd1f6a9101c..dd1f6a9101c 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-full-w1.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-full-w1.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-full-w2.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-full-w2.ttf Binary files differindex c42a506e21a..c42a506e21a 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-full-w2.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-full-w2.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-full-w3.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-full-w3.ttf Binary files differindex f16a77b6edd..f16a77b6edd 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-full-w3.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-full-w3.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-full-w4.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-full-w4.ttf Binary files differindex 8b1abae2f3f..8b1abae2f3f 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-full-w4.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-full-w4.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-full-w5.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-full-w5.ttf Binary files differindex 94aa9996827..94aa9996827 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-full-w5.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-full-w5.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-full-w6.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-full-w6.ttf Binary files differindex 9badb99f500..9badb99f500 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-full-w6.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-full-w6.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-full-w7.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-full-w7.ttf Binary files differindex 049d93d7698..049d93d7698 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-full-w7.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-full-w7.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-full-w8.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-full-w8.ttf Binary files differindex 80169bf0715..80169bf0715 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-full-w8.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-full-w8.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights-full-w9.ttf b/components/fonts/tests/support/CSSTest/csstest-weights-full-w9.ttf Binary files differindex 542e4ab199e..542e4ab199e 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights-full-w9.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights-full-w9.ttf diff --git a/components/gfx/tests/support/CSSTest/csstest-weights.ttf b/components/fonts/tests/support/CSSTest/csstest-weights.ttf Binary files differindex b9c5a507f23..b9c5a507f23 100644 --- a/components/gfx/tests/support/CSSTest/csstest-weights.ttf +++ b/components/fonts/tests/support/CSSTest/csstest-weights.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/AUTHORS b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/AUTHORS index 55c2bc9906f..55c2bc9906f 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/AUTHORS +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/AUTHORS diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/BUGS b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/BUGS index 43d1c940138..43d1c940138 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/BUGS +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/BUGS diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/LICENSE b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/LICENSE index df52c1709be..df52c1709be 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/LICENSE +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/LICENSE diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/NEWS b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/NEWS index 2a2ee370806..2a2ee370806 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/NEWS +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/NEWS diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/README.md b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/README.md index 43148d7c7bf..43148d7c7bf 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/README.md +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/README.md diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans-mono.conf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans-mono.conf index 102dbcc4a8e..102dbcc4a8e 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans-mono.conf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans-mono.conf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans.conf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans.conf index ee69996dc0b..ee69996dc0b 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans.conf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-sans.conf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-serif.conf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-serif.conf index cf6caa2cd3a..cf6caa2cd3a 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-serif.conf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/20-unhint-small-dejavu-serif.conf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans-mono.conf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans-mono.conf index cc42561e382..cc42561e382 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans-mono.conf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans-mono.conf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans.conf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans.conf index 565cab5fc50..565cab5fc50 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans.conf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-sans.conf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-serif.conf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-serif.conf index a922e9b2dca..a922e9b2dca 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-serif.conf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/fontconfig/57-dejavu-serif.conf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/langcover.txt b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/langcover.txt index 75105316c4e..75105316c4e 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/langcover.txt +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/langcover.txt diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/status.txt b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/status.txt index 8b78cf38be5..8b78cf38be5 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/status.txt +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/status.txt diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuMathTeXGyre.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuMathTeXGyre.ttf Binary files differindex 8a24f06400e..8a24f06400e 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuMathTeXGyre.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuMathTeXGyre.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Bold.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Bold.ttf Binary files differindex 6d65fa7dc41..6d65fa7dc41 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Bold.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Bold.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-BoldOblique.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-BoldOblique.ttf Binary files differindex 753f2d80b1f..753f2d80b1f 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-BoldOblique.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-BoldOblique.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-ExtraLight.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-ExtraLight.ttf Binary files differindex b09f32d7d6a..b09f32d7d6a 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-ExtraLight.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-ExtraLight.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Oblique.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Oblique.ttf Binary files differindex 999bac77141..999bac77141 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Oblique.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans-Oblique.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf Binary files differindex e5f7eecce43..e5f7eecce43 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSans.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Bold.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Bold.ttf Binary files differindex 22987c62d93..22987c62d93 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Bold.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Bold.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-BoldOblique.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-BoldOblique.ttf Binary files differindex f5fa0ca26f4..f5fa0ca26f4 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-BoldOblique.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-BoldOblique.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Oblique.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Oblique.ttf Binary files differindex 7fde9078940..7fde9078940 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Oblique.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed-Oblique.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed.ttf Binary files differindex 3259bc21ae0..3259bc21ae0 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansCondensed.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Bold.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Bold.ttf Binary files differindex 8184ced8cf8..8184ced8cf8 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Bold.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Bold.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-BoldOblique.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-BoldOblique.ttf Binary files differindex 754dca7325d..754dca7325d 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-BoldOblique.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-BoldOblique.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Oblique.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Oblique.ttf Binary files differindex 4c858d401ad..4c858d401ad 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Oblique.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono-Oblique.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf Binary files differindex f5786022f18..f5786022f18 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Bold.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Bold.ttf Binary files differindex 3bb755fa1ea..3bb755fa1ea 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Bold.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Bold.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-BoldItalic.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-BoldItalic.ttf Binary files differindex a36dd4b70a8..a36dd4b70a8 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-BoldItalic.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-BoldItalic.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Italic.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Italic.ttf Binary files differindex 805daf2228b..805daf2228b 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Italic.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif-Italic.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif.ttf Binary files differindex 0b803d206c1..0b803d206c1 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerif.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Bold.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Bold.ttf Binary files differindex 222bf134bca..222bf134bca 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Bold.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Bold.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-BoldItalic.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-BoldItalic.ttf Binary files differindex e44663695d5..e44663695d5 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-BoldItalic.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-BoldItalic.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Italic.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Italic.ttf Binary files differindex c529df31bff..c529df31bff 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Italic.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed-Italic.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed.ttf b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed.ttf Binary files differindex d3959b32286..d3959b32286 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed.ttf +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/ttf/DejaVuSerifCondensed.ttf diff --git a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/unicover.txt b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/unicover.txt index fc05f99b430..fc05f99b430 100644 --- a/components/gfx/tests/support/dejavu-fonts-ttf-2.37/unicover.txt +++ b/components/fonts/tests/support/dejavu-fonts-ttf-2.37/unicover.txt diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs deleted file mode 100644 index fc4533d4d4b..00000000000 --- a/components/gfx/lib.rs +++ /dev/null @@ -1,14 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -#![deny(unsafe_code)] - -pub mod font; -pub mod font_cache_thread; -pub mod font_context; -pub mod font_store; -pub mod font_template; -#[allow(unsafe_code)] -pub mod platform; -pub mod text; diff --git a/components/gfx/text/shaping/mod.rs b/components/gfx/text/shaping/mod.rs deleted file mode 100644 index 3862654fe6f..00000000000 --- a/components/gfx/text/shaping/mod.rs +++ /dev/null @@ -1,18 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -//! Shaper encapsulates a specific shaper, such as Harfbuzz, -//! Uniscribe, Pango, or Coretext. -//! -//! Currently, only harfbuzz bindings are implemented. - -pub use self::harfbuzz::Shaper; -use crate::font::ShapingOptions; -use crate::text::glyph::GlyphStore; - -pub mod harfbuzz; - -pub trait ShaperMethods { - fn shape_text(&self, text: &str, options: &ShapingOptions, glyphs: &mut GlyphStore); -} diff --git a/components/gfx/text/util.rs b/components/gfx/text/util.rs deleted file mode 100644 index feceb973eae..00000000000 --- a/components/gfx/text/util.rs +++ /dev/null @@ -1,11 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -pub fn float_to_fixed(before: usize, f: f64) -> i32 { - ((1i32 << before) as f64 * f) as i32 -} - -pub fn fixed_to_float(before: usize, f: i32) -> f64 { - f as f64 * 1.0f64 / ((1i32 << before) as f64) -} diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index edd0a1a88dc..1c716acf9db 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -21,8 +21,8 @@ canvas_traits = { workspace = true } embedder_traits = { workspace = true } euclid = { workspace = true } fnv = { workspace = true } -gfx = { path = "../gfx" } -gfx_traits = { workspace = true } +fonts = { path = "../fonts" } +fonts_traits = { workspace = true } html5ever = { workspace = true } ipc-channel = { workspace = true } lazy_static = { workspace = true } diff --git a/components/layout/context.rs b/components/layout/context.rs index 5767717e371..022d5c8d5b8 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -11,8 +11,7 @@ use std::thread; use base::id::PipelineId; use fnv::FnvHasher; -use gfx::font_cache_thread::FontCacheThread; -use gfx::font_context::FontContext; +use fonts::{FontCacheThread, FontContext}; use net_traits::image_cache::{ ImageCache, ImageCacheResult, ImageOrMetadataAvailable, UsePlaceholder, }; diff --git a/components/layout/display_list/builder.rs b/components/layout/display_list/builder.rs index c018448360e..d1e67c9724d 100644 --- a/components/layout/display_list/builder.rs +++ b/components/layout/display_list/builder.rs @@ -20,7 +20,7 @@ use embedder_traits::Cursor; use euclid::default::{Point2D, Rect, SideOffsets2D as UntypedSideOffsets2D, Size2D}; use euclid::{rect, SideOffsets2D}; use fnv::FnvHashMap; -use gfx::text::glyph::ByteIndex; +use fonts::ByteIndex; use ipc_channel::ipc; use log::{debug, warn}; use net_traits::image_cache::UsePlaceholder; diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index c3e75dad2f4..967bdfb1df3 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -16,7 +16,7 @@ use base::text::is_bidi_control; use bitflags::bitflags; use canvas_traits::canvas::{CanvasId, CanvasMsg}; use euclid::default::{Point2D, Rect, Size2D, Vector2D}; -use gfx::text::glyph::ByteIndex; +use fonts::ByteIndex; use html5ever::{local_name, namespace_url, ns}; use ipc_channel::ipc::IpcSender; use log::debug; diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 733235ed09f..e6da98ccee8 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -11,7 +11,7 @@ use app_units::{Au, MIN_AU}; use base::print_tree::PrintTree; use bitflags::bitflags; use euclid::default::{Point2D, Rect, Size2D}; -use gfx::font::FontMetrics; +use fonts::FontMetrics; use log::debug; use range::{int_range_index, Range, RangeIndex}; use script_layout_interface::wrapper_traits::PseudoElementType; diff --git a/components/layout/text.rs b/components/layout/text.rs index e52484c3113..873622f0b38 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -10,9 +10,10 @@ use std::sync::Arc; use app_units::Au; use base::text::is_bidi_control; -use gfx::font::{self, FontMetrics, FontRef, RunMetrics, ShapingFlags, ShapingOptions}; -use gfx::font_cache_thread::FontIdentifier; -use gfx::text::glyph::ByteIndex; +use fonts::{ + self, ByteIndex, FontIdentifier, FontMetrics, FontRef, RunMetrics, ShapingFlags, + ShapingOptions, LAST_RESORT_GLYPH_ADVANCE, +}; use log::{debug, warn}; use range::Range; use style::computed_values::text_rendering::T as TextRendering; @@ -211,7 +212,7 @@ impl TextRunScanner { font.glyph_index(' ') .map(|glyph_id| font.glyph_h_advance(glyph_id)) }) - .unwrap_or(font::LAST_RESORT_GLYPH_ADVANCE); + .unwrap_or(LAST_RESORT_GLYPH_ADVANCE); inherited_text_style .word_spacing .to_used_value(Au::from_f64_px(space_width)) diff --git a/components/layout/text_run.rs b/components/layout/text_run.rs index fed03e48822..d860cb97890 100644 --- a/components/layout/text_run.rs +++ b/components/layout/text_run.rs @@ -8,8 +8,9 @@ use std::slice::Iter; use std::sync::Arc; use app_units::Au; -use gfx::font::{FontMetrics, FontRef, RunMetrics, ShapingFlags, ShapingOptions}; -use gfx::text::glyph::{ByteIndex, GlyphRun, GlyphStore}; +use fonts::{ + ByteIndex, FontMetrics, FontRef, GlyphRun, GlyphStore, RunMetrics, ShapingFlags, ShapingOptions, +}; use log::debug; use range::Range; use serde::{Deserialize, Serialize}; diff --git a/components/layout_2020/Cargo.toml b/components/layout_2020/Cargo.toml index 0ffa3aa3fb0..7993595c9d2 100644 --- a/components/layout_2020/Cargo.toml +++ b/components/layout_2020/Cargo.toml @@ -23,8 +23,8 @@ embedder_traits = { workspace = true } euclid = { workspace = true } fnv = { workspace = true } fxhash = { workspace = true } -gfx = { path = "../gfx" } -gfx_traits = { workspace = true } +fonts = { path = "../fonts" } +fonts_traits = { workspace = true } html5ever = { workspace = true } icu_segmenter = { workspace = true } ipc-channel = { workspace = true } diff --git a/components/layout_2020/context.rs b/components/layout_2020/context.rs index bfeac3035e3..82b953f18aa 100644 --- a/components/layout_2020/context.rs +++ b/components/layout_2020/context.rs @@ -6,8 +6,7 @@ use std::sync::Arc; use base::id::PipelineId; use fnv::FnvHashMap; -use gfx::font_cache_thread::FontCacheThread; -use gfx::font_context::FontContext; +use fonts::{FontCacheThread, FontContext}; use net_traits::image_cache::{ ImageCache, ImageCacheResult, ImageOrMetadataAvailable, UsePlaceholder, }; diff --git a/components/layout_2020/display_list/mod.rs b/components/layout_2020/display_list/mod.rs index 22f5aeec337..dd91f3b72c8 100644 --- a/components/layout_2020/display_list/mod.rs +++ b/components/layout_2020/display_list/mod.rs @@ -10,7 +10,7 @@ use base::WebRenderEpochToU16; use embedder_traits::Cursor; use euclid::{Point2D, SideOffsets2D, Size2D}; use fnv::FnvHashMap; -use gfx::text::glyph::GlyphStore; +use fonts::GlyphStore; use net_traits::image_cache::UsePlaceholder; use servo_geometry::MaxRect; use style::color::{AbsoluteColor, ColorSpace}; @@ -962,7 +962,7 @@ fn glyphs( mut baseline_origin: PhysicalPoint<Length>, justification_adjustment: Length, ) -> Vec<wr::GlyphInstance> { - use gfx_traits::ByteIndex; + use fonts_traits::ByteIndex; use range::Range; let mut glyphs = vec![]; diff --git a/components/layout_2020/flow/inline/line.rs b/components/layout_2020/flow/inline/line.rs index 77e428aa90e..f8752298de3 100644 --- a/components/layout_2020/flow/inline/line.rs +++ b/components/layout_2020/flow/inline/line.rs @@ -6,8 +6,7 @@ use std::vec::IntoIter; use app_units::Au; use atomic_refcell::AtomicRef; -use gfx::font::FontMetrics; -use gfx::text::glyph::GlyphStore; +use fonts::{FontMetrics, GlyphStore}; use servo_arc::Arc; use style::computed_values::white_space_collapse::T as WhiteSpaceCollapse; use style::properties::ComputedValues; diff --git a/components/layout_2020/flow/inline/mod.rs b/components/layout_2020/flow/inline/mod.rs index 18aeb24734b..29ef49ab3f7 100644 --- a/components/layout_2020/flow/inline/mod.rs +++ b/components/layout_2020/flow/inline/mod.rs @@ -79,8 +79,7 @@ use std::mem; use app_units::Au; use bitflags::bitflags; use construct::InlineFormattingContextBuilder; -use gfx::font::FontMetrics; -use gfx::text::glyph::GlyphStore; +use fonts::{FontMetrics, GlyphStore}; use line::{ layout_line_items, AbsolutelyPositionedLineItem, AtomicLineItem, FloatLineItem, InlineBoxLineItem, LineItem, LineItemLayoutState, LineMetrics, TextRunLineItem, diff --git a/components/layout_2020/flow/inline/text_run.rs b/components/layout_2020/flow/inline/text_run.rs index 0b563703f46..d22e7a7c693 100644 --- a/components/layout_2020/flow/inline/text_run.rs +++ b/components/layout_2020/flow/inline/text_run.rs @@ -6,11 +6,11 @@ use std::mem; use std::ops::Range; use app_units::Au; -use gfx::font::{FontRef, ShapingFlags, ShapingOptions}; -use gfx::font_cache_thread::FontCacheThread; -use gfx::font_context::FontContext; -use gfx::text::glyph::GlyphRun; -use gfx_traits::ByteIndex; +use fonts::{ + FontCacheThread, FontContext, FontRef, GlyphRun, ShapingFlags, ShapingOptions, + LAST_RESORT_GLYPH_ADVANCE, +}; +use fonts_traits::ByteIndex; use log::warn; use range::Range as ServoRange; use serde::Serialize; @@ -371,7 +371,7 @@ impl TextRun { let space_width = font .glyph_index(' ') .map(|glyph_id| font.glyph_h_advance(glyph_id)) - .unwrap_or(gfx::font::LAST_RESORT_GLYPH_ADVANCE); + .unwrap_or(LAST_RESORT_GLYPH_ADVANCE); specified_word_spacing.to_used_value(Au::from_f64_px(space_width)) }); diff --git a/components/layout_2020/fragment_tree/fragment.rs b/components/layout_2020/fragment_tree/fragment.rs index a5dc9b0433c..ace0bfc0b27 100644 --- a/components/layout_2020/fragment_tree/fragment.rs +++ b/components/layout_2020/fragment_tree/fragment.rs @@ -7,8 +7,7 @@ use std::sync::Arc; use app_units::Au; use base::id::{BrowsingContextId, PipelineId}; use base::print_tree::PrintTree; -use gfx::font::FontMetrics; -use gfx::text::glyph::GlyphStore; +use fonts::{FontMetrics, GlyphStore}; use serde::Serialize; use servo_arc::Arc as ServoArc; use style::properties::ComputedValues; diff --git a/components/layout_thread/Cargo.toml b/components/layout_thread/Cargo.toml index 61cd1c2fb14..53331fedd80 100644 --- a/components/layout_thread/Cargo.toml +++ b/components/layout_thread/Cargo.toml @@ -18,8 +18,8 @@ embedder_traits = { workspace = true } euclid = { workspace = true } fnv = { workspace = true } fxhash = { workspace = true } -gfx = { path = "../gfx" } -gfx_traits = { workspace = true } +fonts = { path = "../fonts" } +fonts_traits = { workspace = true } histogram = "0.6.8" ipc-channel = { workspace = true } layout = { path = "../layout", package = "layout_2013" } diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 803c3f7c829..1d8c3d89a72 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -21,11 +21,12 @@ use embedder_traits::resources::{self, Resource}; use euclid::default::{Point2D as UntypedPoint2D, Rect as UntypedRect, Size2D as UntypedSize2D}; use euclid::{Point2D, Rect, Scale, Size2D}; use fnv::FnvHashMap; +use fonts::{ + get_and_reset_text_shaping_performance_counter, FontCacheThread, FontContext, + FontContextWebFontMethods, +}; +use fonts_traits::WebFontLoadFinishedCallback; use fxhash::{FxHashMap, FxHashSet}; -use gfx::font; -use gfx::font_cache_thread::FontCacheThread; -use gfx::font_context::{FontContext, FontContextWebFontMethods}; -use gfx_traits::WebFontLoadFinishedCallback; use histogram::Histogram; use ipc_channel::ipc::IpcSender; use layout::construct::ConstructionResult; @@ -1119,8 +1120,7 @@ impl LayoutThread { }, ); // TODO(pcwalton): Measure energy usage of text shaping, perhaps? - let text_shaping_time = - font::get_and_reset_text_shaping_performance_counter() / num_threads; + let text_shaping_time = get_and_reset_text_shaping_performance_counter() / num_threads; profile_time::send_profile_data( profile_time::ProfilerCategory::LayoutTextShaping, self.profiler_metadata(), diff --git a/components/layout_thread_2020/Cargo.toml b/components/layout_thread_2020/Cargo.toml index e1bdd664895..b8d4dfaade0 100644 --- a/components/layout_thread_2020/Cargo.toml +++ b/components/layout_thread_2020/Cargo.toml @@ -18,8 +18,8 @@ embedder_traits = { workspace = true } euclid = { workspace = true } fnv = { workspace = true } fxhash = { workspace = true } -gfx = { path = "../gfx" } -gfx_traits = { workspace = true } +fonts = { path = "../fonts" } +fonts_traits = { workspace = true } ipc-channel = { workspace = true } layout = { path = "../layout_2020", package = "layout_2020" } lazy_static = { workspace = true } diff --git a/components/layout_thread_2020/lib.rs b/components/layout_thread_2020/lib.rs index e392a3b6f1b..32b3ea89e77 100644 --- a/components/layout_thread_2020/lib.rs +++ b/components/layout_thread_2020/lib.rs @@ -22,10 +22,9 @@ use embedder_traits::resources::{self, Resource}; use euclid::default::{Point2D as UntypedPoint2D, Rect as UntypedRect, Size2D as UntypedSize2D}; use euclid::{Point2D, Scale, Size2D, Vector2D}; use fnv::FnvHashMap; +use fonts::{FontCacheThread, FontContext, FontContextWebFontMethods}; +use fonts_traits::WebFontLoadFinishedCallback; use fxhash::FxHashMap; -use gfx::font_cache_thread::FontCacheThread; -use gfx::font_context::{FontContext, FontContextWebFontMethods}; -use gfx_traits::WebFontLoadFinishedCallback; use ipc_channel::ipc::IpcSender; use layout::context::LayoutContext; use layout::display_list::{DisplayList, WebRenderImageInfo}; diff --git a/components/metrics/Cargo.toml b/components/metrics/Cargo.toml index 44864913a7a..f2464ccf24b 100644 --- a/components/metrics/Cargo.toml +++ b/components/metrics/Cargo.toml @@ -12,7 +12,7 @@ path = "lib.rs" [dependencies] base = { workspace = true } -gfx_traits = { workspace = true } +fonts_traits = { workspace = true } ipc-channel = { workspace = true } log = { workspace = true } malloc_size_of = { workspace = true } diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index f8a26d20790..d87ae88e0ab 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -53,8 +53,8 @@ enum-iterator = "0.3" euclid = { workspace = true } fnv = { workspace = true } fxhash = { workspace = true } -gfx_traits = { workspace = true } -gfx = { path = "../gfx" } +fonts_traits = { workspace = true } +fonts = { path = "../fonts" } headers = { workspace = true } html5ever = { workspace = true } http = { workspace = true } diff --git a/components/script/layout_dom/node.rs b/components/script/layout_dom/node.rs index f4e014a6a1b..efb05a2f121 100644 --- a/components/script/layout_dom/node.rs +++ b/components/script/layout_dom/node.rs @@ -9,7 +9,7 @@ use std::fmt; use std::sync::Arc as StdArc; use base::id::{BrowsingContextId, PipelineId}; -use gfx_traits::ByteIndex; +use fonts_traits::ByteIndex; use html5ever::{local_name, namespace_url, ns}; use pixels::{Image, ImageMetadata}; use range::Range; diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 8a8a80b9c2a..1d3fb58766a 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -47,7 +47,7 @@ use devtools_traits::{ }; use embedder_traits::EmbedderMsg; use euclid::default::{Point2D, Rect}; -use gfx::font_cache_thread::FontCacheThread; +use fonts::FontCacheThread; use headers::{HeaderMapExt, LastModified, ReferrerPolicy as ReferrerPolicyHeader}; use html5ever::{local_name, namespace_url, ns}; use hyper_serde::Serde; diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml index 1ca1ee27562..8cee2c8b1d6 100644 --- a/components/servo/Cargo.toml +++ b/components/servo/Cargo.toml @@ -48,8 +48,8 @@ devtools_traits = { workspace = true } embedder_traits = { workspace = true } env_logger = { workspace = true } euclid = { workspace = true } -gfx = { path = "../gfx" } -gfx_traits = { workspace = true } +fonts = { path = "../fonts" } +fonts_traits = { workspace = true } gleam = { workspace = true } gstreamer = { workspace = true, optional = true } ipc-channel = { workspace = true } diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 282fee3f67c..a135fef1f63 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -55,6 +55,7 @@ use crossbeam_channel::{unbounded, Sender}; use embedder_traits::{EmbedderMsg, EmbedderProxy, EmbedderReceiver, EventLoopWaker}; use env_logger::Builder as EnvLoggerBuilder; use euclid::Scale; +use fonts::FontCacheThread; #[cfg(all( not(target_os = "windows"), not(target_os = "ios"), @@ -64,7 +65,6 @@ use euclid::Scale; not(target_env = "ohos"), ))] use gaol::sandbox::{ChildSandbox, ChildSandboxMethods}; -use gfx::font_cache_thread::FontCacheThread; pub use gleam::gl; use ipc_channel::ipc::{self, IpcSender}; use log::{error, trace, warn, Log, Metadata, Record}; @@ -97,7 +97,7 @@ use webrender_traits::{ }; pub use { background_hang_monitor, base, bluetooth, bluetooth_traits, canvas, canvas_traits, compositing, - constellation, devtools, devtools_traits, embedder_traits, euclid, gfx, ipc_channel, + constellation, devtools, devtools_traits, embedder_traits, euclid, fonts, ipc_channel, keyboard_types, layout_thread_2013, layout_thread_2020, media, net, net_traits, profile, profile_traits, script, script_layout_interface, script_traits, servo_config as config, servo_config, servo_geometry, servo_url as url, servo_url, style, style_traits, webgpu, diff --git a/components/shared/compositing/Cargo.toml b/components/shared/compositing/Cargo.toml index ca31ce4201f..f46a35f6e03 100644 --- a/components/shared/compositing/Cargo.toml +++ b/components/shared/compositing/Cargo.toml @@ -15,7 +15,7 @@ base = { workspace = true } crossbeam-channel = { workspace = true } embedder_traits = { workspace = true } euclid = { workspace = true } -gfx_traits = { workspace = true } +fonts_traits = { workspace = true } ipc-channel = { workspace = true } keyboard-types = { workspace = true } log = { workspace = true } diff --git a/components/shared/gfx/Cargo.toml b/components/shared/fonts/Cargo.toml index ffcbcc53c9f..32e10a7e389 100644 --- a/components/shared/gfx/Cargo.toml +++ b/components/shared/fonts/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "gfx_traits" +name = "fonts_traits" version.workspace = true authors.workspace = true license.workspace = true @@ -7,7 +7,7 @@ edition.workspace = true publish.workspace = true [lib] -name = "gfx_traits" +name = "fonts_traits" path = "lib.rs" [dependencies] diff --git a/components/shared/gfx/lib.rs b/components/shared/fonts/lib.rs index 032dcfd19e0..032dcfd19e0 100644 --- a/components/shared/gfx/lib.rs +++ b/components/shared/fonts/lib.rs diff --git a/components/shared/script/Cargo.toml b/components/shared/script/Cargo.toml index 7624b542498..c8303658efa 100644 --- a/components/shared/script/Cargo.toml +++ b/components/shared/script/Cargo.toml @@ -21,7 +21,7 @@ crossbeam-channel = { workspace = true } devtools_traits = { workspace = true } embedder_traits = { workspace = true } euclid = { workspace = true } -gfx_traits = { workspace = true } +fonts_traits = { workspace = true } http = { workspace = true } hyper_serde = { workspace = true } ipc-channel = { workspace = true } diff --git a/components/shared/script_layout/Cargo.toml b/components/shared/script_layout/Cargo.toml index f4e310510ee..922df1ba324 100644 --- a/components/shared/script_layout/Cargo.toml +++ b/components/shared/script_layout/Cargo.toml @@ -17,8 +17,8 @@ atomic_refcell = { workspace = true } canvas_traits = { workspace = true } crossbeam-channel = { workspace = true } euclid = { workspace = true } -gfx = { path = "../../gfx" } -gfx_traits = { workspace = true } +fonts = { path = "../../fonts" } +fonts_traits = { workspace = true } html5ever = { workspace = true } ipc-channel = { workspace = true } libc = { workspace = true } diff --git a/components/shared/script_layout/lib.rs b/components/shared/script_layout/lib.rs index baf885e3524..bb9099e8b45 100644 --- a/components/shared/script_layout/lib.rs +++ b/components/shared/script_layout/lib.rs @@ -23,7 +23,7 @@ use canvas_traits::canvas::{CanvasId, CanvasMsg}; use crossbeam_channel::Sender; use euclid::default::{Point2D, Rect}; use euclid::Size2D; -use gfx::font_cache_thread::FontCacheThread; +use fonts::FontCacheThread; use ipc_channel::ipc::IpcSender; use libc::c_void; use malloc_size_of_derive::MallocSizeOf; diff --git a/components/shared/script_layout/wrapper_traits.rs b/components/shared/script_layout/wrapper_traits.rs index fe3fc69f47e..5c8da0315b4 100644 --- a/components/shared/script_layout/wrapper_traits.rs +++ b/components/shared/script_layout/wrapper_traits.rs @@ -10,7 +10,7 @@ use std::sync::Arc as StdArc; use atomic_refcell::AtomicRef; use base::id::{BrowsingContextId, PipelineId}; -use gfx_traits::ByteIndex; +use fonts_traits::ByteIndex; use html5ever::{local_name, namespace_url, ns, LocalName, Namespace}; use pixels::{Image, ImageMetadata}; use range::Range; |