Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ typeface = pixie.read_typeface("examples/data/Ubuntu-Regular_1.ttf")
def make_font(typeface, size, color):
font = typeface.new_font()
font.size = size
font.paints[0].color = color
font.paint.color = color
return font

spans = pixie.SeqSpan()
Expand Down
Binary file modified examples/blur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/shadow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/text_spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def make_font(typeface, size, color):
font = typeface.new_font()
font.size = size
font.paints[0].color = color
font.paint.color = color
return font

spans = pixie.SeqSpan()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name = "pixie-python",
version = "0.1.5",
version = "3.0.2",
author = "Andre von Houck",
author_email = "starplant@gmail.com",
description = "Python bindings for Pixie, a full-featured 2D graphics library",
Expand Down
Binary file modified src/pixie/libpixie.so
Binary file not shown.
Binary file modified src/pixie/pixie.dll
Binary file not shown.
14 changes: 14 additions & 0 deletions src/pixie/pixie.py
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,14 @@ def clear(self):
def paints(self):
return self.FontPaints(self)

@property
def paint(self):
return dll.pixie_font_get_paint(self)

@paint.setter
def paint(self, paint):
dll.pixie_font_set_paint(self, paint)

@property
def text_case(self):
return dll.pixie_font_get_text_case(self)
Expand Down Expand Up @@ -2310,6 +2318,12 @@ def inverse(m):
dll.pixie_font_paints_clear.argtypes = [Font]
dll.pixie_font_paints_clear.restype = None

dll.pixie_font_get_paint.argtypes = [Font]
dll.pixie_font_get_paint.restype = Paint

dll.pixie_font_set_paint.argtypes = [Font, Paint]
dll.pixie_font_set_paint.restype = None

dll.pixie_font_get_text_case.argtypes = [Font]
dll.pixie_font_get_text_case.restype = TextCase

Expand Down
Binary file modified tests/images/blur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/shadow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/masks/blur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions tests/test_font.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def test_fields():
assert font.strikethrough
font.no_kerning_adjustment = True
assert font.no_kerning_adjustment
paint = pixie.Paint(pixie.PK_SOLID)
paint.color = pixie.Color(1, 1, 0, 1)
font.paint = paint
assert font.paint.color == paint.color

def test_paints():
font = pixie.read_font("tests/fonts/Roboto-Regular_1.ttf")
Expand Down