Registry / serialization / booleanoperations

booleanoperations

JSON →
library0.10.0pypypi✓ verified 80d ago

Boolean operations on paths (union, intersection, difference, xor) for font glyph contours. Version 0.10.0, released 2024-04-29. Uses pyclipper (Clipper) for computation. Requires Python >=3.9. Maintained by TypeMyType.

pip install booleanoperations
INSTALL
IMPORT
SIG · BOOLEANOPERATIONS
B
booleanoperations
serializationpythonv0.10.0
Install
2.7s avg
Import
Disk
46MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.10.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.7s · import 0.000s · 47MB
46MB installed
● package 46MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BooleanOperationManager
from booleanOperations import BooleanOperationManager
from booleanOperations import BooleanOperations
union
from booleanOperations import union
from booleanOperations import BooleanOperations
difference
from booleanOperations import difference
from booleanOperations import BooleanOperations

Basic union of a glyph outline and a rectangle. Output is a recording pen value.

from fontTools.pens.t2Pen import T2Pen from fontTools.pens.recordingPen import RecordingPen from fontTools.ttLib import TTFont from fontTools.pens.pointPen import PointToSegmentPen from booleanOperations import BooleanOperations # Load a font, get a glyph font = TTFont('MyFont.otf') glyph = font.getGlyphSet()['A'] # Create a rectangle as a closed path rect_pen = RecordingPen() rect_pen.moveTo((0, 0)) rect_pen.lineTo((100, 0)) rect_pen.lineTo((100, 100)) rect_pen.lineTo((0, 100)) rect_pen.closePath() # Get glyph outline glyph_pen = RecordingPen() glyph.draw(glyph_pen) # Perform union op = BooleanOperations() result_pen = RecordingPen() op.union(glyph_pen.value, rect_pen.value, result_pen) print('Union result:', result_pen.value)
Debug
Known issues
breakingSupport for Python 2.7 dropped in v0.9.0. Requires Python >=3.6 (v0.9.0) or >=3.9 (v0.10.0).
fix
Upgrade to Python 3.9+ for latest version.
affects: >=0.9.0
gotchaOpen contours (not closed) raise OpenContourError. Only closed paths are supported.
fix
Ensure all input paths are closed (last point equals first).
affects: >=0.8.0
gotchaSelf-intersecting contours with zero area are dropped (may produce unexpected results).
fix
Upgrade to 0.8.2 or later to avoid dropped contours.
affects: <0.8.2
breakingufoLib dependency removed in v0.8.1; now requires fonttools >=3.32.0.
fix
Ensure fonttools is 3.32.0 or higher.
affects: >=0.8.1
Upgrade
Version history
0.10.0latest on PyPI · released Jan 15, 2026
Audit
Dependencies
fonttoolsrequiredCore dependency for font data structures (Glyph, Pen, etc.)
pyclipperrequiredComputational geometry library for boolean operations
Agent activity
11 hits · last 30 days
node
8
Amazon
1
OpenAI (training)
1
Resources
booleanoperations — pip install booleanoperations · libregistry