mirror of
https://github.com/google/mozc-devices.git
synced 2025-11-08 16:53:28 +03:00
Set background color to keymap.svg.
This commit is contained in:
@@ -9,6 +9,9 @@ class SvgGenerator:
|
|||||||
size=(f"{width}mm", f"{height}mm"), profile="full"
|
size=(f"{width}mm", f"{height}mm"), profile="full"
|
||||||
)
|
)
|
||||||
self.dwg.viewbox(0, 0, width, height)
|
self.dwg.viewbox(0, 0, width, height)
|
||||||
|
self.dwg.add(
|
||||||
|
self.dwg.rect(insert=(0, 0), size=("100%", "100%"), fill="white")
|
||||||
|
)
|
||||||
|
|
||||||
def circle(self, center_x, center_y, size, stroke="black", fill="none"):
|
def circle(self, center_x, center_y, size, stroke="black", fill="none"):
|
||||||
radius = size / 2
|
radius = size / 2
|
||||||
@@ -147,10 +150,10 @@ if __name__ == "__main__":
|
|||||||
# ラベルの長さに応じてフォントサイズを調整
|
# ラベルの長さに応じてフォントサイズを調整
|
||||||
if len(label) > 8:
|
if len(label) > 8:
|
||||||
font_size = 2.0
|
font_size = 2.0
|
||||||
elif len(label) > 4:
|
elif len(label) > 2:
|
||||||
font_size = 3.0
|
font_size = 3.0
|
||||||
else:
|
else:
|
||||||
font_size = 4.0
|
font_size = 8.0
|
||||||
generator.text(small_x, small_y, label, font_size=font_size)
|
generator.text(small_x, small_y, label, font_size=font_size)
|
||||||
|
|
||||||
output_filename = "keymap.svg"
|
output_filename = "keymap.svg"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Reference in New Issue
Block a user