Gnumed.timelinelib.drawing.drawers.default

Package Gnumed :: Package timelinelib :: Package drawing :: Package drawers :: Module default |
[frames] | no frames]

# Module default

source code

Classes
| DefaultDrawingAlgorithm

Functions
break_text(text, dc, max_width_in_px) Break the text into lines so that they fits within the given width. | source code
break_sentence(dc, lines, sentence, max_width_in_px) Break a sentence into lines. | source code
break_line(dc, sentence, max_word_len_in_ch) Break a sentence into words. | source code
break_word(dc, word, max_word_len_in_ch) Break words if they are too long. | source code
get_max_word_length(dc, max_width_in_px) | source code

Variables
| OUTER_PADDING = `5`
| INNER_PADDING = `3`
| PERIOD_THRESHOLD = `20`
| BALLOON_RADIUS = `12`
| DATA_INDICATOR_SIZE = `10`
| CONTRAST_RATIO_THREASHOLD = `2250`
| WHITE = `255, 255, 255`
| BLACK = `0, 0, 0`

Imports: math, os, wx, ICONS_DIR, sort_categories, Drawer, TimelineScene, darken_color, get_default_font

Function Details

### break_word(dc, word, max_word_len_in_ch) | source code
Break words if they are too long. If a single word is too long to fit we have to break it. If not we just return the word given.