@@ -7,18 +7,15 @@ use crate::foundations::{dict, func, Content, Context, Dict, Resolve, Smart};
7
7
use crate :: introspection:: { Locator , LocatorLink } ;
8
8
use crate :: layout:: { Abs , Axes , Length , Region , Size } ;
9
9
10
- /// Measures the layouted size of content.
10
+ /// レイアウトされたコンテンツの測定。
11
11
///
12
- /// The `measure` function lets you determine the layouted size of content.
13
- /// By default an infinite space is assumed, so the measured dimensions may
14
- /// not necessarily match the final dimensions of the content.
15
- /// If you want to measure in the current layout dimensions, you can combine
16
- /// `measure` and [`layout`].
12
+ /// `measure`関数を用いるとレイアウトされたコンテンツの大きさを測定できます。
13
+ /// デフォルトでは無限のスペースが想定されているため、測定された寸法は必ずしもコンテンツの最終的な寸法に一致するとは限りません。
14
+ /// 現在のレイアウトの寸法が測定したい場合は、`measure`と[`layout`]を組み合わせることができます。
17
15
///
18
- /// # Example
19
- /// The same content can have a different size depending on the [context] that
20
- /// it is placed into. In the example below, the `[#content]` is of course
21
- /// bigger when we increase the font size.
16
+ /// # 例
17
+ /// 同じコンテンツでも置く場所の[context]によって異なる大きさになることがあります。
18
+ /// 以下の例では、フォントサイズを大きくすると`[#content]`は必然的に大きくなります。
22
19
///
23
20
/// ```example
24
21
/// #let content = [Hello!]
@@ -27,7 +24,7 @@ use crate::layout::{Abs, Axes, Length, Region, Size};
27
24
/// #content
28
25
/// ```
29
26
///
30
- /// For this reason, you can only measure when context is available.
27
+ /// この理由から、測定が可能なのはコンテキストが利用可能な場合に限ります。
31
28
///
32
29
/// ```example
33
30
/// #let thing(body) = context {
@@ -39,21 +36,18 @@ use crate::layout::{Abs, Axes, Length, Region, Size};
39
36
/// #thing[Welcome]
40
37
/// ```
41
38
///
42
- /// The measure function returns a dictionary with the entries `width` and
43
- /// `height`, both of type [`length`].
39
+ /// measure関数はキーが`width`と`height`で、その値がいずれも[`length`]型の辞書を返します。
44
40
#[ func( contextual) ]
45
41
pub fn measure (
46
42
engine : & mut Engine ,
47
43
context : Tracked < Context > ,
48
44
span : Span ,
49
- /// The width available to layout the content.
45
+ /// コンテンツをレイアウトするのに利用可能な幅。
50
46
///
51
- /// Setting this to `{auto}` indicates infinite available width.
47
+ /// これを `{auto}`に設定すると無限大の幅が利用可能であると見なされます。
52
48
///
53
- /// Note that using the `width` and `height` parameters of this function is
54
- /// different from measuring a sized [`block`] containing the content. In
55
- /// the following example, the former will get the dimensions of the inner
56
- /// content instead of the dimensions of the block.
49
+ /// この関数の`width`および`height`パラメーターを用いることは、大きさを持ち、コンテンツを有する[`block`]を測定することとは異なることに注意してください。
50
+ /// 以下の例では、前者はブロックの寸法ではなく、内側のコンテンツの寸法を取得します。
57
51
///
58
52
/// ```example
59
53
/// #context measure(lorem(100), width: 400pt)
@@ -63,13 +57,13 @@ pub fn measure(
63
57
#[ named]
64
58
#[ default( Smart :: Auto ) ]
65
59
width : Smart < Length > ,
66
- /// The height available to layout the content.
60
+ /// コンテンツをレイアウトするのに利用可能な高さ。
67
61
///
68
- /// Setting this to `{auto}` indicates infinite available height.
62
+ /// これを `{auto}`に設定すると無限大の高さが利用可能であると見なされます。
69
63
#[ named]
70
64
#[ default( Smart :: Auto ) ]
71
65
height : Smart < Length > ,
72
- /// The content whose size to measure.
66
+ /// 大きさを測定するコンテンツ。
73
67
content : Content ,
74
68
) -> SourceResult < Dict > {
75
69
// Create a pod region with the available space.
0 commit comments