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

Commit5bcd22e

Browse files
committed
Better subpixel positioning?
1 parent1670dde commit5bcd22e

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

‎lib/matplotlib/mathtext.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,23 @@ def get_results(self, box, used_characters):
190190
orig_height=box.height
191191
orig_depth=box.depth
192192
ship(0,0,box)
193-
xmin=self._xmin-1
194-
xmax=self._xmax+1
195-
ymin=self._ymin-1
196-
ymax=self._ymax+1
197-
image=FT2Image(np.ceil(xmax-xmin),np.ceil(ymax-ymin))
193+
xmin=np.floor(self._xmin)
194+
xmax=np.ceil(self._xmax)
195+
ymin=np.floor(self._ymin)
196+
ymax=np.ceil(self._ymax)
197+
dxmin=self._xmin-xmin
198+
dymin=self._ymin-ymin
199+
image=FT2Image(np.ceil(xmax-xmin)+1,np.ceil(ymax-ymin)+1)
198200

199201
forox,oy,infoinself._glyphs:
200202
info.font.draw_glyph_to_bitmap(
201-
image,ox+1,oy-info.metrics.iceberg+1,
203+
image,ox+dxmin,oy-info.metrics.iceberg+dymin,
202204
info.glyph,antialiased=rcParams['text.antialiased'])
203205
forx1,y1,x2,y2inself._rects:
204-
x1+=1
205-
x2+=1
206-
y1+=1
207-
y2+=1
206+
x1+=dxmin
207+
x2+=dymin
208+
y1+=dxmin
209+
y2+=dymin
208210
height=max(int(y2-y1)-1,0)
209211
ifheight==0:
210212
center= (y2+y1)/2

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp