Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions crates/typst-library/src/text/deco.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ impl Show for Packed<StrikeElem> {
}
}

/// Highlights text with a background color.
/// 背景色によるテキストハイライト。
///
/// # Example
/// #
/// ```example
/// This is #highlight[important].
/// ```
#[elem(Show)]
pub struct HighlightElem {
/// The color to highlight the text with.
/// テキストをハイライトする色。
///
/// ```example
/// This is #highlight(
Expand All @@ -280,8 +280,8 @@ pub struct HighlightElem {
#[default(Some(Color::from_u8(0xFF, 0xFD, 0x11, 0xA1).into()))]
pub fill: Option<Paint>,

/// The highlight's border color. See the
/// [rectangle's documentation]($rect.stroke) for more details.
/// ハイライトの枠線の色。
/// 詳細は[rectangleのドキュメント]($rect.stroke)を参照してください。
///
/// ```example
/// This is a #highlight(
Expand All @@ -292,7 +292,7 @@ pub struct HighlightElem {
#[fold]
pub stroke: Sides<Option<Option<Stroke>>>,

/// The top end of the background rectangle.
/// 背景の長方形の上端。
///
/// ```example
/// #set highlight(top-edge: "ascender")
Expand All @@ -304,7 +304,7 @@ pub struct HighlightElem {
#[default(TopEdge::Metric(TopEdgeMetric::Ascender))]
pub top_edge: TopEdge,

/// The bottom end of the background rectangle.
/// 背景の長方形の下端。
///
/// ```example
/// #set highlight(bottom-edge: "descender")
Expand All @@ -316,17 +316,16 @@ pub struct HighlightElem {
#[default(BottomEdge::Metric(BottomEdgeMetric::Descender))]
pub bottom_edge: BottomEdge,

/// The amount by which to extend the background to the sides beyond
/// (or within if negative) the content.
/// コンテンツの外側に(負の値のときは内側に)背景を左右に拡張する量。
///
/// ```example
/// A long #highlight(extent: 4pt)[background].
/// ```
#[resolve]
pub extent: Length,

/// How much to round the highlight's corners. See the
/// [rectangle's documentation]($rect.radius) for more details.
/// 背景の角を丸める量。
/// 詳細は[rectangleのドキュメント]($rect.radius)を参照してください。
///
/// ```example
/// Listen #highlight(
Expand All @@ -337,7 +336,7 @@ pub struct HighlightElem {
#[fold]
pub radius: Corners<Option<Rel<Length>>>,

/// The content that should be highlighted.
/// ハイライトされるべきコンテンツ。
#[required]
pub body: Content,
}
Expand Down
16 changes: 8 additions & 8 deletions crates/typst-library/src/text/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1014,15 +1014,15 @@ cast! {
/// Metrics that describe the top edge of text.
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Cast)]
pub enum TopEdgeMetric {
/// The font's ascender, which typically exceeds the height of all glyphs.
/// フォントアセンダー。通常、これは全ての字形の高さを超えます。
Ascender,
/// The approximate height of uppercase letters.
/// 大文字の高さの近似値。
CapHeight,
/// The approximate height of non-ascending lowercase letters.
/// アセンダーを持たない小文字の高さの近似値。
XHeight,
/// The baseline on which the letters rest.
/// 文字が置かれるベースライン。
Baseline,
/// The top edge of the glyph's bounding box.
/// 字形が持つバウンディングボックスの上端。
Bounds,
}

Expand Down Expand Up @@ -1062,11 +1062,11 @@ cast! {
/// Metrics that describe the bottom edge of text.
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Cast)]
pub enum BottomEdgeMetric {
/// The baseline on which the letters rest.
/// 文字が置かれるベースライン。
Baseline,
/// The font's descender, which typically exceeds the depth of all glyphs.
/// フォントディセンダー。通常、これは全ての字形の深さを超えます。
Descender,
/// The bottom edge of the glyph's bounding box.
/// 字形が持つバウンディングボックスの下端。
Bounds,
}

Expand Down
2 changes: 1 addition & 1 deletion website/translation-status.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"/docs/reference/model/table/": "untranslated",
"/docs/reference/model/terms/": "untranslated",
"/docs/reference/text/": "untranslated",
"/docs/reference/text/highlight/": "untranslated",
"/docs/reference/text/highlight/": "translated",
"/docs/reference/text/linebreak/": "translated",
"/docs/reference/text/lorem/": "untranslated",
"/docs/reference/text/lower/": "untranslated",
Expand Down