Adjusted variable names and comments to better match specification

This commit is contained in:
Andrew Murray 2023-02-25 14:04:10 +11:00 committed by Aarni Koskela
parent fcc59a4001
commit c799bd8a03

View File

@ -64,16 +64,18 @@ def bdf_char(f):
bitmap.append(s[:-1]) bitmap.append(s[:-1])
bitmap = b"".join(bitmap) bitmap = b"".join(bitmap)
# The word BBX followed by the width in x (BBw), height in y (BBh), # The word BBX
# and x and y displacement (BBox, BBoy) of the lower left corner # followed by the width in x (BBw), height in y (BBh),
# from the origin of the character. # and x and y displacement (BBxoff0, BByoff0)
# of the lower left corner from the origin of the character.
width, height, x_disp, y_disp = [int(p) for p in props["BBX"].split()] width, height, x_disp, y_disp = [int(p) for p in props["BBX"].split()]
# The word DWIDTH followed by the width in x and y of the character in device units. # The word DWIDTH
dx, dy = [int(p) for p in props["DWIDTH"].split()] # followed by the width in x and y of the character in device pixels.
dwx, dwy = [int(p) for p in props["DWIDTH"].split()]
bbox = ( bbox = (
(dx, dy), (dwx, dwy),
(x_disp, -y_disp - height, width + x_disp, -y_disp), (x_disp, -y_disp - height, width + x_disp, -y_disp),
(0, 0, width, height), (0, 0, width, height),
) )