From bd23a5ffa21c484bc28618efe94484a0d72dc968 Mon Sep 17 00:00:00 2001 From: ultimatile Date: Mon, 18 Aug 2025 15:56:22 +0900 Subject: [PATCH 1/3] =?UTF-8?q?`/docs/reference/text/sub`=E3=81=AE?= =?UTF-8?q?=E7=BF=BB=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/text/shift.rs | 25 +++++++++++-------------- website/translation-status.json | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/crates/typst-library/src/text/shift.rs b/crates/typst-library/src/text/shift.rs index 3eec0758b..03da9d20c 100644 --- a/crates/typst-library/src/text/shift.rs +++ b/crates/typst-library/src/text/shift.rs @@ -7,21 +7,20 @@ use crate::layout::{Em, Length}; use crate::text::{variant, SpaceElem, TextElem, TextSize}; use crate::World; -/// Renders text in subscript. +/// テキストを下付き文字でレンダリング。 /// -/// The text is rendered smaller and its baseline is lowered. +/// テキストは小さくレンダリングされ、ベースラインは低くなります。 /// -/// # Example +/// # 例 /// ```example /// Revenue#sub[yearly] /// ``` #[elem(title = "Subscript", Show)] pub struct SubElem { - /// Whether to prefer the dedicated subscript characters of the font. + /// フォントの下付き文字専用の字形を優先するかどうか。 /// - /// If this is enabled, Typst first tries to transform the text to subscript - /// codepoints. If that fails, it falls back to rendering lowered and shrunk - /// normal letters. + /// 有効化された場合、Typstは最初にテキストを下付き文字のコードポイントに変換できるか試します。 + /// 失敗した場合は、通常の文字を縮小し、位置を下げる挙動にフォールバックします。 /// /// ```example /// N#sub(typographic: true)[1] @@ -30,19 +29,17 @@ pub struct SubElem { #[default(true)] pub typographic: bool, - /// The baseline shift for synthetic subscripts. Does not apply if - /// `typographic` is true and the font has subscript codepoints for the - /// given `body`. + /// 下付き文字の合成に用いるベースラインのシフト。 + /// `typographic`がtrueかつフォントが与えられた`body`に対して下付き文字のコードポイントを持っている場合は使用しないでください。 #[default(Em::new(0.2).into())] pub baseline: Length, - /// The font size for synthetic subscripts. Does not apply if - /// `typographic` is true and the font has subscript codepoints for the - /// given `body`. + /// 下付き文字の合成に用いるフォントの大きさ。 + /// `typographic`がtrueかつフォントが与えられた`body`に対して下付き文字のコードポイントを持っている場合は使用しないでください。 #[default(TextSize(Em::new(0.6).into()))] pub size: TextSize, - /// The text to display in subscript. + /// 下付き文字で表示するテキスト。 #[required] pub body: Content, } diff --git a/website/translation-status.json b/website/translation-status.json index da11b248b..508d31377 100644 --- a/website/translation-status.json +++ b/website/translation-status.json @@ -72,7 +72,7 @@ "/docs/reference/text/smallcaps/": "translated", "/docs/reference/text/smartquote/": "untranslated", "/docs/reference/text/strike/": "translated", - "/docs/reference/text/sub/": "untranslated", + "/docs/reference/text/sub/": "translated", "/docs/reference/text/super/": "untranslated", "/docs/reference/text/text/": "untranslated", "/docs/reference/text/underline/": "translated", From a8df44198d7de563016100a7b08673676ea60eec Mon Sep 17 00:00:00 2001 From: ultimatile Date: Thu, 21 Aug 2025 03:03:36 +0900 Subject: [PATCH 2/3] =?UTF-8?q?`/docs/reference/text/super`=E3=81=AE?= =?UTF-8?q?=E7=BF=BB=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/typst-library/src/text/shift.rs | 25 +++++++++++-------------- website/translation-status.json | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/crates/typst-library/src/text/shift.rs b/crates/typst-library/src/text/shift.rs index 03da9d20c..1656679db 100644 --- a/crates/typst-library/src/text/shift.rs +++ b/crates/typst-library/src/text/shift.rs @@ -63,21 +63,20 @@ impl Show for Packed { } } -/// Renders text in superscript. +/// テキストを上付き文字でレンダリング。 /// -/// The text is rendered smaller and its baseline is raised. +/// テキストは小さくレンダリングされ、ベースラインは高くなります。 /// -/// # Example +/// # 例 /// ```example /// 1#super[st] try! /// ``` #[elem(title = "Superscript", Show)] pub struct SuperElem { - /// Whether to prefer the dedicated superscript characters of the font. + /// フォントの上付き文字専用の字形を優先するかどうか。 /// - /// If this is enabled, Typst first tries to transform the text to - /// superscript codepoints. If that fails, it falls back to rendering - /// raised and shrunk normal letters. + /// 有効化された場合、Typstは最初にテキストを上付き文字のコードポイントに変換できるか試します。 + /// 失敗した場合は、通常の文字を縮小し、位置を上げる挙動にフォールバックします。 /// /// ```example /// N#super(typographic: true)[1] @@ -86,19 +85,17 @@ pub struct SuperElem { #[default(true)] pub typographic: bool, - /// The baseline shift for synthetic superscripts. Does not apply if - /// `typographic` is true and the font has superscript codepoints for the - /// given `body`. + /// 上付き文字の合成に用いるベースラインのシフト。 + /// `typographic`がtrueかつフォントが与えられた`body`に対して上付き文字のコードポイントを持っている場合は使用しないでください。 #[default(Em::new(-0.5).into())] pub baseline: Length, - /// The font size for synthetic superscripts. Does not apply if - /// `typographic` is true and the font has superscript codepoints for the - /// given `body`. + /// 上付き文字の合成に用いるフォントの大きさ。 + /// `typographic`がtrueかつフォントが与えられた`body`に対して上付き文字のコードポイントを持っている場合は使用しないでください。 #[default(TextSize(Em::new(0.6).into()))] pub size: TextSize, - /// The text to display in superscript. + /// 上付き文字で表示するテキスト。 #[required] pub body: Content, } diff --git a/website/translation-status.json b/website/translation-status.json index 508d31377..70b5e8b1d 100644 --- a/website/translation-status.json +++ b/website/translation-status.json @@ -73,7 +73,7 @@ "/docs/reference/text/smartquote/": "untranslated", "/docs/reference/text/strike/": "translated", "/docs/reference/text/sub/": "translated", - "/docs/reference/text/super/": "untranslated", + "/docs/reference/text/super/": "translated", "/docs/reference/text/text/": "untranslated", "/docs/reference/text/underline/": "translated", "/docs/reference/text/upper/": "translated", From 6e2aae27cc0171e257b066c223c6ef0ffca841a5 Mon Sep 17 00:00:00 2001 From: ultimatile Date: Thu, 21 Aug 2025 03:55:44 +0900 Subject: [PATCH 3/3] Update crates/typst-library/src/text/shift.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- crates/typst-library/src/text/shift.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/typst-library/src/text/shift.rs b/crates/typst-library/src/text/shift.rs index 1656679db..781a224e6 100644 --- a/crates/typst-library/src/text/shift.rs +++ b/crates/typst-library/src/text/shift.rs @@ -30,12 +30,12 @@ pub struct SubElem { pub typographic: bool, /// 下付き文字の合成に用いるベースラインのシフト。 - /// `typographic`がtrueかつフォントが与えられた`body`に対して下付き文字のコードポイントを持っている場合は使用しないでください。 + /// `typographic`がtrueかつ与えられた`body`に対してフォントが下付き文字のコードポイントを持っている場合は適用されません。 #[default(Em::new(0.2).into())] pub baseline: Length, /// 下付き文字の合成に用いるフォントの大きさ。 - /// `typographic`がtrueかつフォントが与えられた`body`に対して下付き文字のコードポイントを持っている場合は使用しないでください。 + /// `typographic`がtrueかつ与えられた`body`に対してフォントが下付き文字のコードポイントを持っている場合は適用されません。 #[default(TextSize(Em::new(0.6).into()))] pub size: TextSize, @@ -86,12 +86,12 @@ pub struct SuperElem { pub typographic: bool, /// 上付き文字の合成に用いるベースラインのシフト。 - /// `typographic`がtrueかつフォントが与えられた`body`に対して上付き文字のコードポイントを持っている場合は使用しないでください。 + /// `typographic`がtrueかつ与えられた`body`に対してフォントが上付き文字のコードポイントを持っている場合は適用されません。 #[default(Em::new(-0.5).into())] pub baseline: Length, /// 上付き文字の合成に用いるフォントの大きさ。 - /// `typographic`がtrueかつフォントが与えられた`body`に対して上付き文字のコードポイントを持っている場合は使用しないでください。 + /// `typographic`がtrueかつ与えられた`body`に対してフォントが上付き文字のコードポイントを持っている場合は適用されません。 #[default(TextSize(Em::new(0.6).into()))] pub size: TextSize,