mirror of
https://github.com/typst/typst
synced 2025-08-21 10:18:35 +08:00
Update internal doc
This commit is contained in:
parent
545e083bf3
commit
7295c80ed5
@ -804,7 +804,7 @@ fn shape_segment<'a>(
|
|||||||
let (script_shift, script_compensation, scale, shift_feature) = ctx
|
let (script_shift, script_compensation, scale, shift_feature) = ctx
|
||||||
.shift_settings
|
.shift_settings
|
||||||
.map_or((Em::zero(), Em::zero(), Em::one(), None), |settings| {
|
.map_or((Em::zero(), Em::zero(), Em::one(), None), |settings| {
|
||||||
compute_synthesized_shift(text, &font, settings)
|
determine_shift(text, &font, settings)
|
||||||
});
|
});
|
||||||
|
|
||||||
let has_shift_feature = shift_feature.is_some();
|
let has_shift_feature = shift_feature.is_some();
|
||||||
@ -961,16 +961,15 @@ fn shape_segment<'a>(
|
|||||||
ctx.used.pop();
|
ctx.used.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a `(script_shift, script_compensation, scale)` triplet describing
|
/// Returns a `(script_shift, script_compensation, scale, feature)` quadruplet
|
||||||
/// how to synthesize scripts.
|
/// describing how to produce scripts.
|
||||||
///
|
///
|
||||||
/// Those values determine how the rendered text should be transformed to
|
/// Those values determine how the rendered text should be transformed to
|
||||||
/// display sub-/super-scripts. If the text is not scripted, or if the OpenType
|
/// display sub-/super-scripts. If the OpenType feature can be used, the
|
||||||
/// feature can be used, the rendered text should not be transformed in any way,
|
/// rendered text should not be transformed in any way, and so those values are
|
||||||
/// and so those values are neutral (`(0, 0, 1)`). If scripts should be
|
/// neutral (`(0, 0, 1, None)`). If scripts should be synthesized, those values
|
||||||
/// synthesized, those values determine how to transform the rendered text to
|
/// determine how to transform the rendered text to display scripts as expected.
|
||||||
/// display scripts as expected.
|
fn determine_shift(
|
||||||
fn compute_synthesized_shift(
|
|
||||||
text: &str,
|
text: &str,
|
||||||
font: &Font,
|
font: &Font,
|
||||||
settings: ShiftSettings,
|
settings: ShiftSettings,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user