129 lines
3.4 KiB
Python
129 lines
3.4 KiB
Python
"""
|
|
Sample data for testing Text Texture Generator functions.
|
|
Provides common inputs like text samples, dimensions, and configurations.
|
|
"""
|
|
|
|
# Sample text data for testing
|
|
SHORT_TEXT = "Hello World"
|
|
LONG_TEXT = "This is a much longer piece of text that should wrap across multiple lines when constrained by width limits in the text processing system."
|
|
MULTILINE_TEXT = "Line 1\nLine 2\nLine 3\nLine 4"
|
|
EMPTY_TEXT = ""
|
|
UNICODE_TEXT = "Hello 世界 🌍 こんにちは"
|
|
|
|
# Sample dimensions
|
|
SMALL_DIMENSIONS = {"width": 100, "height": 100}
|
|
STANDARD_DIMENSIONS = {"width": 512, "height": 512}
|
|
LARGE_DIMENSIONS = {"width": 1024, "height": 1024}
|
|
PORTRAIT_DIMENSIONS = {"width": 400, "height": 600}
|
|
LANDSCAPE_DIMENSIONS = {"width": 800, "height": 400}
|
|
|
|
# Sample font sizes
|
|
FONT_SIZE_SMALL = 12
|
|
FONT_SIZE_MEDIUM = 24
|
|
FONT_SIZE_LARGE = 48
|
|
FONT_SIZE_XLARGE = 72
|
|
|
|
# Sample colors (RGBA format for Blender, 0-1 range)
|
|
COLOR_WHITE = (1.0, 1.0, 1.0, 1.0)
|
|
COLOR_BLACK = (0.0, 0.0, 0.0, 1.0)
|
|
COLOR_RED = (1.0, 0.0, 0.0, 1.0)
|
|
COLOR_BLUE = (0.0, 0.0, 1.0, 1.0)
|
|
COLOR_TRANSPARENT = (0.0, 0.0, 0.0, 0.0)
|
|
|
|
# Sample overlays for area calculations
|
|
SAMPLE_OVERLAYS_EMPTY = []
|
|
SAMPLE_OVERLAYS_SINGLE = [
|
|
{'x': 50, 'y': 50, 'width': 100, 'height': 100}
|
|
]
|
|
SAMPLE_OVERLAYS_MULTIPLE = [
|
|
{'x': 50, 'y': 50, 'width': 100, 'height': 100},
|
|
{'x': 200, 'y': 200, 'width': 80, 'height': 80},
|
|
{'x': 300, 'y': 100, 'width': 60, 'height': 120}
|
|
]
|
|
|
|
# Sample text positions for overlap testing
|
|
TEXT_POSITIONS_NO_OVERLAP = [
|
|
{'x': 0, 'y': 0, 'width': 100, 'height': 50},
|
|
{'x': 150, 'y': 0, 'width': 100, 'height': 50},
|
|
{'x': 0, 'y': 100, 'width': 100, 'height': 50}
|
|
]
|
|
|
|
TEXT_POSITIONS_WITH_OVERLAP = [
|
|
{'x': 0, 'y': 0, 'width': 100, 'height': 50},
|
|
{'x': 50, 'y': 25, 'width': 100, 'height': 50}, # Overlaps first
|
|
{'x': 200, 'y': 0, 'width': 100, 'height': 50}
|
|
]
|
|
|
|
# Sample available areas
|
|
AVAILABLE_AREA_SMALL = {
|
|
'x': 10,
|
|
'y': 10,
|
|
'width': 100,
|
|
'height': 50,
|
|
'area': 5000
|
|
}
|
|
|
|
AVAILABLE_AREA_MEDIUM = {
|
|
'x': 50,
|
|
'y': 50,
|
|
'width': 200,
|
|
'height': 150,
|
|
'area': 30000
|
|
}
|
|
|
|
AVAILABLE_AREA_LARGE = {
|
|
'x': 0,
|
|
'y': 0,
|
|
'width': 500,
|
|
'height': 400,
|
|
'area': 200000
|
|
}
|
|
|
|
# Text alignment options
|
|
TEXT_ALIGNMENTS = [
|
|
'center',
|
|
'top-left', 'top-center', 'top-right',
|
|
'center-left', 'center-right',
|
|
'bottom-left', 'bottom-center', 'bottom-right'
|
|
]
|
|
|
|
# Sample histogram data for rectangle calculations
|
|
HISTOGRAM_SIMPLE = [3, 1, 3, 2, 2]
|
|
HISTOGRAM_INCREASING = [1, 2, 3, 4, 5]
|
|
HISTOGRAM_DECREASING = [5, 4, 3, 2, 1]
|
|
HISTOGRAM_PYRAMID = [1, 2, 3, 4, 3, 2, 1]
|
|
HISTOGRAM_ZERO_VALUES = [0, 0, 3, 3, 0, 0]
|
|
|
|
# Text block layouts for optimization testing
|
|
TEXT_BLOCKS_SIMPLE = [
|
|
{'x': 0, 'y': 0, 'width': 100, 'height': 50, 'text': 'Block 1'},
|
|
{'x': 200, 'y': 200, 'width': 80, 'height': 40, 'text': 'Block 2'}
|
|
]
|
|
|
|
TEXT_BLOCKS_OVERLAPPING = [
|
|
{'x': 0, 'y': 0, 'width': 100, 'height': 100, 'text': 'Block 1'},
|
|
{'x': 50, 'y': 50, 'width': 100, 'height': 100, 'text': 'Block 2'},
|
|
{'x': 25, 'y': 25, 'width': 50, 'height': 50, 'text': 'Block 3'}
|
|
]
|
|
|
|
# Font size constraints for testing
|
|
FONT_CONSTRAINTS_NORMAL = {
|
|
'min_size': 8,
|
|
'max_size': 72,
|
|
'target_width': 200,
|
|
'target_height': 100
|
|
}
|
|
|
|
FONT_CONSTRAINTS_TIGHT = {
|
|
'min_size': 8,
|
|
'max_size': 20,
|
|
'target_width': 50,
|
|
'target_height': 30
|
|
}
|
|
|
|
FONT_CONSTRAINTS_LOOSE = {
|
|
'min_size': 20,
|
|
'max_size': 200,
|
|
'target_width': 800,
|
|
'target_height': 600
|
|
} |