mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-26 03:53:41 +03:00
Clarify variable names in PcfFontFile
Co-authored-by: Yay295 <Yay295@users.noreply.github.com>
This commit is contained in:
parent
04be46d484
commit
6f79e653d6
|
@ -86,9 +86,23 @@ class PcfFontFile(FontFile.FontFile):
|
||||||
|
|
||||||
for ch, ix in enumerate(encoding):
|
for ch, ix in enumerate(encoding):
|
||||||
if ix is not None:
|
if ix is not None:
|
||||||
x, y, l, r, w, a, d, f = metrics[ix]
|
ix_metrics = metrics[ix]
|
||||||
glyph = (w, 0), (l, d - y, x + l, d), (0, 0, x, y), bitmaps[ix]
|
(
|
||||||
self.glyph[ch] = glyph
|
xsize,
|
||||||
|
ysize,
|
||||||
|
left,
|
||||||
|
right,
|
||||||
|
width,
|
||||||
|
ascent,
|
||||||
|
descent,
|
||||||
|
attributes,
|
||||||
|
) = ix_metrics
|
||||||
|
self.glyph[ch] = (
|
||||||
|
(width, 0),
|
||||||
|
(left, descent - ysize, xsize + left, descent),
|
||||||
|
(0, 0, xsize, ysize),
|
||||||
|
bitmaps[ix],
|
||||||
|
)
|
||||||
|
|
||||||
def _getformat(self, tag):
|
def _getformat(self, tag):
|
||||||
format, size, offset = self.toc[tag]
|
format, size, offset = self.toc[tag]
|
||||||
|
@ -206,7 +220,7 @@ class PcfFontFile(FontFile.FontFile):
|
||||||
mode = "1"
|
mode = "1"
|
||||||
|
|
||||||
for i in range(nbitmaps):
|
for i in range(nbitmaps):
|
||||||
x, y, l, r, w, a, d, f = metrics[i]
|
x, y = metrics[i][0], metrics[i][1]
|
||||||
b, e = offsets[i], offsets[i + 1]
|
b, e = offsets[i], offsets[i + 1]
|
||||||
bitmaps.append(Image.frombytes("1", (x, y), data[b:e], "raw", mode, pad(x)))
|
bitmaps.append(Image.frombytes("1", (x, y), data[b:e], "raw", mode, pad(x)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user