def handle_letter(letter, mode):
    letter_paper = draw_letter(
        letter,
        mode,
        fixed_width=30.0,
        show_template=True,
        fuse=False,
    )
    letter_paper.translate((5, 0), bounds=False)

    p = Pen()
    p.move_to((-8, 3))
    p.text(
        letter.case,
        6.0,
        font,
        gray,
        centered=True,
    )
    p.move_to((-8, -3))
    p.text(
        ', '.join(lookup(letter.case)),
        6.0,
        font,
        gray,
        centered=True,
    )
    letter_paper.merge(p.paper)

    return letter_paper
Exemplo n.º 2
0
def handle_letter(letter, mode):
    letter_paper = draw_letter(
        letter,
        mode,
        fixed_width=30.0,
        show_template=True,
        fuse=False,
    )
    letter_paper.translate((5, 0), bounds=False)

    p = Pen()
    p.move_to((-8, 3))
    p.text(
        letter.case,
        6.0,
        font,
        gray,
        centered=True,
    )
    p.move_to((-8, -3))
    p.text(
        ', '.join(lookup(letter.case)),
        6.0,
        font,
        gray,
        centered=True,
    )
    letter_paper.merge(p.paper)

    return letter_paper
import ithkuil.writing.side_ending as se
import ithkuil.writing.bottom_ending as be

font = 'Caudex'
font_size = 8
red = '#d6041a'
black = '#260003'
gray = '#233042'
mode = StrokeOutlineMode(1.0, 0.2, red, black)

papers = []
for consonant_class in consonants:
    letter = consonant_class(se.Normal, be.Normal)
    letter_paper = draw_letter(
        letter,
        mode,
        fixed_width=27.0,
        show_template=True,
    )
    letter_paper.translate((5, 0), bounds=False)

    p = Pen()
    p.move_to((-5, 0))
    p.text(
        convert_ascii_to_html(consonant_class.pronunciation),
        8.0,
        'Caudex',
        '#233042',
        centered=True,
    )
    letter_paper.merge(p.paper)
    papers.append(letter_paper)
Exemplo n.º 4
0
red = '#d6041a'
black = '#260003'
gray = '#233042'
mode = StrokeOutlineMode(1.0, 0.2, red, black)

pairs = []
for bottom_ending_class in bottom_endings:
    pairs.append((
        cons.BottomEndingStraightStub(None, bottom_ending_class),
        cons.BottomEndingSlantedStub(None, bottom_ending_class),
    ))

papers = []
for straight_letter, slanted_letter in pairs:
    paper = Paper()
    straight_paper = draw_letter(straight_letter, mode)
    slanted_paper = draw_letter(slanted_letter, mode)

    # Adjust for scythe bottom ending.
    if straight_letter.bottom_ending_class == be.Scythe:
        for letter_paper in [straight_paper, slanted_paper]:
            bounds = letter_paper.bounds()
            bounds.right += 2.0
            letter_paper.override_bounds(bounds)

    # Assemble the two bottom endings onto one paper.
    paper.merge(straight_paper)
    offset_x = straight_paper.bounds().right - slanted_paper.bounds().left
    slanted_paper.translate((offset_x + 1.0, 0))
    paper.merge(slanted_paper)
    paper.center_on_x(0)
Exemplo n.º 5
0
    else:
        seen.add((c, s, b))
    letters.append(c(s, b))

for bottom_ending_class in bottom_endings:
    for consonant_class in consonants:
        add_letter(consonant_class, side_endings[0], bottom_ending_class)
for side_ending_class in side_endings:
    for consonant_class in consonants:
        add_letter(consonant_class, side_ending_class, bottom_endings[0])

papers = [
    draw_letter(
        letter,
        mode,
        fixed_width=10.0,
        show_template=True,
        #show_bounds=True,
        #fuse=False,
    )
    for letter in letters
]
page = typeset(
    papers,
    letter_spacing=2.0,
    letters_per_line=10,
    #line_width=100,
    line_spacing=3.0,
    page_margin=5.0,
)
print(page.format_svg(4, resolution=30))
#page.format_svg()
Exemplo n.º 6
0
from ithkuil.writing.bottom_ending import bottom_endings
from ithkuil.writing.side_ending import side_endings
from ithkuil.writing.typeset import typeset, draw_letter


#DEBUG redefinition of parts lists for testing.
import ithkuil.writing.consonant as cons
import ithkuil.writing.side_ending as se
import ithkuil.writing.bottom_ending as be


letters = [
    cons.Q(se.DiagonalDownRightOnTop, be.HookLeftOnRight),
    cons.CHacekStop(se.HookRightOnBottom, be.AcuteFold),
]

papers = []
for letter in letters:
    for width in (0.4, 0.6, 0.8, 1.0, 1.2, 1.4):
        mode = StrokeMode(width)
        papers.append(draw_letter(letter, mode))

page = typeset(
    papers,
    letter_spacing=2.0,
    letters_per_line=6,
    line_spacing=1.0,
    page_margin=5.0,
)
print(page.format_svg(6))
import ithkuil.writing.side_ending as se
import ithkuil.writing.bottom_ending as be
consonants = [c for c in consonants if not c.mirrored_x]

letters = []
for consonant_class in consonants:
    letters.append(consonant_class(se.SideAll, be.BottomAll))

papers = []
for width in [0.6, 1.0, 1.2]:
    mode = StrokeMode(width)
    for letter in letters:
        papers.append(draw_letter(
            letter,
            mode,
            fixed_width=10.0,
            show_template=True,
            #show_bounds=True,
            fuse=False,
        ))

page = typeset(
    papers,
    letter_spacing=2.0,
    letters_per_line=len(consonants),
    line_spacing=3.0,
    page_margin=5.0,
)
print(page.format_svg(4, resolution=30))
Exemplo n.º 8
0
        seen.add((c, s, b))
    letters.append(c(s, b))


for bottom_ending_class in bottom_endings:
    for consonant_class in consonants:
        add_letter(consonant_class, side_endings[0], bottom_ending_class)
for side_ending_class in side_endings:
    for consonant_class in consonants:
        add_letter(consonant_class, side_ending_class, bottom_endings[0])

papers = [
    draw_letter(
        letter,
        mode,
        fixed_width=10.0,
        show_template=True,
        #show_bounds=True,
        #fuse=False,
    ) for letter in letters
]
page = typeset(
    papers,
    letter_spacing=2.0,
    letters_per_line=10,
    #line_width=100,
    line_spacing=3.0,
    page_margin=5.0,
)
print(page.format_svg(4, resolution=30))
#page.format_svg()
from canoepaddle import Pen, StrokeOutlineMode

from ithkuil.writing.consonant import consonants
from ithkuil.writing.typeset import draw_letter, typeset
from ithkuil.phonology import convert_ascii_to_html
import ithkuil.writing.side_ending as se
import ithkuil.writing.bottom_ending as be

font = "Caudex"
font_size = 8
red = "#d6041a"
black = "#260003"
gray = "#233042"
mode = StrokeOutlineMode(1.0, 0.2, red, black)

papers = []
for consonant_class in consonants:
    letter = consonant_class(se.Normal, be.Normal)
    letter_paper = draw_letter(letter, mode, fixed_width=27.0, show_template=True)
    letter_paper.translate((5, 0), bounds=False)

    p = Pen()
    p.move_to((-5, 0))
    p.text(convert_ascii_to_html(consonant_class.pronunciation), 8.0, "Caudex", "#233042", centered=True)
    letter_paper.merge(p.paper)
    papers.append(letter_paper)

page = typeset(papers, letter_spacing=1.0, letters_per_line=6, line_spacing=3.5, page_margin=5.0)

print(page.format_svg(4, resolution=1000 / page.bounds().width))
Exemplo n.º 10
0
from canoepaddle import Pen, StrokeOutlineMode

font = 'Caudex'
font_size = 3
red = '#d6041a'
black = '#260003'
gray = '#233042'
mode = StrokeOutlineMode(1.0, 0.2, red, black)

letters = [
    cons.SideEndingStub(side_ending, None) for side_ending in side_endings
]

papers = []
for letter in letters:
    paper = draw_letter(letter, mode)

    # Override bounds to be asymmetrical fixed width.
    bounds = paper.bounds()
    bounds.left = -2
    bounds.right = 5
    bounds.bottom = 3
    if letter.side_ending_class.relation == 'UNFRAMED':
        bounds.top = 18
    else:
        bounds.top = 20
    paper.override_bounds(bounds)
    paper.translate((-0.5, 0))

    # Generate text indicating pattern and stem.
    pen = Pen()
Exemplo n.º 11
0
font = 'Caudex'
font_size = 3
red = '#d6041a'
black = '#260003'
gray = '#233042'
mode = StrokeOutlineMode(1.0, 0.2, red, black)

letters = [
    cons.SideEndingStub(side_ending, None)
    for side_ending in side_endings
]

papers = []
for letter in letters:
    paper = draw_letter(letter, mode)

    # Override bounds to be asymmetrical fixed width.
    bounds = paper.bounds()
    bounds.left = -2
    bounds.right = 5
    bounds.bottom = 3
    if letter.side_ending_class.relation == 'UNFRAMED':
        bounds.top = 18
    else:
        bounds.top = 20
    paper.override_bounds(bounds)
    paper.translate((-0.5, 0))

    # Generate text indicating pattern and stem.
    pen = Pen()