-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[80_6] Improving Radical Box Typesetting #2118
Changes from 6 commits
cb0aa24
7d6f524
355454e
4417aa4
aac5876
51ff998
5b8f7e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<TMU|<tuple|1.0.4|1.2.9.3-rc2>> | ||
|
||
<style|<tuple|generic|chinese>> | ||
|
||
<\body> | ||
Asana Math: | ||
|
||
<\equation*> | ||
<around*|{|<sqrt|1234|abc>|}><sqrt|1+<sqrt|2+<sqrt|3+<sqrt|4+<sqrt|5+<sqrt|6+<sqrt|7+<sqrt|8+\<cdots\>>>>>>>>> | ||
</equation*> | ||
|
||
Fira Math: | ||
|
||
<\equation*> | ||
<with|font|Fira Math|<around*|{|<sqrt|1234|abc>|}><sqrt|1+<sqrt|2+<sqrt|3+<sqrt|4+<sqrt|5+<sqrt|6+<sqrt|7+<sqrt|8+\<cdots\>>>>>>>>>> | ||
</equation*> | ||
|
||
TeX Gyre Pagella Math: | ||
|
||
<\equation*> | ||
<with|font|TeX Gyre Pagella Math|<around*|{|<sqrt|1234|abc>|}><sqrt|1+<sqrt|2+<sqrt|3+<sqrt|4+<sqrt|5+<sqrt|6+<sqrt|7+<sqrt|8+\<cdots\>>>>>>>>>> | ||
</equation*> | ||
|
||
\ TeX Gyre Schola Math: | ||
|
||
<with|font|TeX Gyre Schola Math|<\equation*> | ||
<around*|{|<sqrt|1234|abc>|}><sqrt|1+<sqrt|2+<sqrt|3+<sqrt|4+<sqrt|5+<sqrt|6+<sqrt|7+<sqrt|8+\<cdots\>>>>>>>>> | ||
</equation*>> | ||
</body> | ||
|
||
<\initial> | ||
<\collection> | ||
<associate|font|Asana Math> | ||
<associate|font-family|rm> | ||
<associate|font-shape|italic> | ||
<associate|math-font|math-dejavu> | ||
<associate|page-medium|paper> | ||
<associate|page-screen-margin|false> | ||
</collection> | ||
</initial> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,6 +179,8 @@ sqrt_box_rep::sqrt_box_rep (path ip, box b1, box b2, box sqrtb, font fn2, | |
|
||
pencil rpen= pen->set_width (wline); | ||
insert (b1, 0, 0); | ||
bool use_open_type= (fn->math_type == MATH_TYPE_OPENTYPE) && | ||
(fn->sqrt_degree_rise_percent > 0); | ||
if (!is_nil (b2)) { | ||
SI X = -sqrtb->w (); | ||
SI M = X / 3; | ||
|
@@ -191,6 +193,12 @@ sqrt_box_rep::sqrt_box_rep (path ip, box b1, box b2, box sqrtb, font fn2, | |
else if (occurs ("agella", fn->res_name)) Y+= (16 * bw) >> 3; | ||
else Y+= (15 * bw) >> 3; | ||
} | ||
else if (use_open_type) { | ||
Y+= fn->sqrt_degree_rise_percent * sqrtb->h () / 100; | ||
M = fn->sqrt_kern_after_degree; | ||
sep= 0; | ||
b2->x1-= fn->sqrt_kern_before_degree; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a bit confused on this parameter There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenType math table requires spacing both before and after the degree symbol. In the case of b2->x1, the front spacing is added, while M represents the distance from the back of the symbol to the radical. According to the specification, the height of the degree symbol is raised by a fixed proportion of the height of the radical. |
||
} | ||
else { | ||
if (bh < 3 * bw) Y+= bh >> 1; | ||
else Y+= (bw * 3) >> 1; | ||
|
@@ -203,7 +211,7 @@ sqrt_box_rep::sqrt_box_rep (path ip, box b1, box b2, box sqrtb, font fn2, | |
position (); | ||
left_justify (); | ||
y1-= wline; | ||
y2+= wline; | ||
y2+= use_open_type ? fn->sqrt_extra_ascender : wline; | ||
x2+= sep >> 1; | ||
|
||
right_italic_restore (b1); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused