Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfbb9bbc

Browse files
committed
Merge pull request#5871 from zblz/fix-sized-delims
Fix sized delimiters for regular-sized mathtext (#5863)
2 parentsa5aa57d +8bfab64 commitfbb9bbc

File tree

130 files changed

+4080
-4096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+4080
-4096
lines changed

‎lib/matplotlib/mathtext.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,6 @@ def __init__(self, *args, **kwargs):
890890
self.fontmap= {}
891891
# Include Stix sized alternatives for glyphs
892892
self._fontmap.update({
893-
0 :'STIXGeneral',
894893
1 :'STIXSizeOneSym',
895894
2 :'STIXSizeTwoSym',
896895
3 :'STIXSizeThreeSym',
@@ -932,6 +931,7 @@ class DejaVuSerifFonts(DejaVuFonts):
932931
'sf' :'DejaVu Sans',
933932
'tt' :'DejaVu Sans Mono',
934933
'ex' :'DejaVu Serif Display',
934+
0 :'DejaVu Serif',
935935
}
936936

937937
classDejaVuSansFonts(DejaVuFonts):
@@ -946,6 +946,7 @@ class DejaVuSansFonts(DejaVuFonts):
946946
'sf' :'DejaVu Sans',
947947
'tt' :'DejaVu Sans Mono',
948948
'ex' :'DejaVu Sans Display',
949+
0 :'DejaVu Sans',
949950
}
950951

951952
classStixFonts(UnicodeFonts):
@@ -1996,20 +1997,28 @@ def __init__(self, c, height, depth, state, always=False, factor=None):
19961997
alternatives=state.font_output.get_sized_alternatives_for_symbol(
19971998
state.font,c)
19981999

2000+
xHeight=state.font_output.get_xheight(
2001+
state.font,state.fontsize,state.dpi)
2002+
19992003
state=state.copy()
20002004
target_total=height+depth
20012005
forfontname,syminalternatives:
20022006
state.font=fontname
20032007
char=Char(sym,state)
2004-
ifchar.height+char.depth>=target_total:
2008+
# Ensure that size 0 is chosen when the text is regular sized but
2009+
# with descender glyphs by subtracting 0.2 * xHeight
2010+
ifchar.height+char.depth>=target_total-0.2*xHeight:
20052011
break
20062012

2007-
iffactorisNone:
2008-
factor=target_total/ (char.height+char.depth)
2009-
state.fontsize*=factor
2010-
char=Char(sym,state)
2013+
shift=0
2014+
ifstate.font!=0:
2015+
iffactorisNone:
2016+
factor= (target_total)/ (char.height+char.depth)
2017+
state.fontsize*=factor
2018+
char=Char(sym,state)
2019+
2020+
shift= (depth-char.depth)
20112021

2012-
shift= (depth-char.depth)
20132022
Hlist.__init__(self, [char])
20142023
self.shift_amount=shift
20152024

Binary file not shown.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp