Compare commits

..

2 Commits

Author SHA1 Message Date
Max
2ec73593d5
Merge af564e589f7d9bf4d40538f9e35dfbdd78ba87ed into 0a3c6939dd274f40672484695d909c2cc0d0d755 2025-07-08 16:15:30 +00:00
mkorje
af564e589f
WIP 2025-07-09 02:15:16 +10:00
13 changed files with 14 additions and 19 deletions

2
Cargo.lock generated
View File

@ -2911,7 +2911,7 @@ dependencies = [
[[package]]
name = "typst-dev-assets"
version = "0.13.1"
source = "git+https://github.com/mkorje/typst-dev-assets?rev=be2b2d0#be2b2d04092af283ee3651721d38041bf8c72d97"
source = "git+https://github.com/typst/typst-dev-assets?rev=bfa947f#bfa947f3433d7d13a995168c40ae788a2ebfe648"
[[package]]
name = "typst-docs"

View File

@ -33,7 +33,7 @@ typst-syntax = { path = "crates/typst-syntax", version = "0.13.1" }
typst-timing = { path = "crates/typst-timing", version = "0.13.1" }
typst-utils = { path = "crates/typst-utils", version = "0.13.1" }
typst-assets = { git = "https://github.com/typst/typst-assets", rev = "c1089b4" }
typst-dev-assets = { git = "https://github.com/mkorje/typst-dev-assets", rev = "be2b2d0" }
typst-dev-assets = { git = "https://github.com/typst/typst-dev-assets", rev = "bfa947f" }
arrayvec = "0.7.4"
az = "1.2"
base64 = "0.22"

View File

@ -27,7 +27,10 @@ use typst_library::layout::{
use typst_library::math::*;
use typst_library::model::ParElem;
use typst_library::routines::{Arenas, RealizationKind};
use typst_library::text::{LinebreakElem, RawElem, SpaceElem, TextEdgeBounds, TextElem};
use typst_library::text::{
BottomEdge, BottomEdgeMetric, LinebreakElem, RawElem, SpaceElem, TextEdgeBounds,
TextElem, TopEdge, TopEdgeMetric,
};
use typst_utils::Numeric;
use unicode_math_class::MathClass;
@ -522,8 +525,15 @@ fn layout_realized(
} else if let Some(elem) = elem.to_packed::<OvershellElem>() {
self::underover::layout_overshell(elem, ctx, styles)?
} else {
let local = [
TextElem::top_edge.set(TopEdge::Metric(TopEdgeMetric::Bounds)),
TextElem::bottom_edge.set(BottomEdge::Metric(BottomEdgeMetric::Bounds)),
]
.map(|p| p.wrap());
let styles = if elem.is::<RawElem>() { styles.chain(&local) } else { styles };
let mut frame = layout_external(elem, ctx, styles)?;
if !frame.has_baseline() && !elem.is::<RawElem>() {
if !frame.has_baseline() {
let font = find_math_font(ctx.engine.world, styles, elem.span())?;
let axis = value!(font, styles, axis_height);
frame.set_baseline(frame.height() / 2.0 + axis);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 968 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 B

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -17,21 +17,6 @@ $ nothing $
$ "hi ∅ hey" $
$ sum_(i in NN) 1 + i $
--- math-font-features-switch ---
#let scr(it) = text(features: ("ss01",), $cal(it)$)
$cal(P)_i != scr(P)_i$, $cal(bold(I))_l != bold(scr(I))_l$
$ product.co_(B in scr(B))^(B in scr(bold(B))) cal(B)(X) $
--- math-font-covers ---
#show math.equation: set text(
font: (
// Ignore that this regex actually misses some of the script glyphs...
(name: "XITS Math", covers: regex("[\u{1D49C}-\u{1D503}]")),
),
features: ("ss01",),
)
$ cal(P)_i (X) * cal(C)_1 $
--- math-optical-size-nested-scripts ---
// Test transition from script to scriptscript.
#[