Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SerCeMan/fontogen
/ functions
Functions
71 in github.com/SerCeMan/fontogen
⨍
Functions
71
◇
Types & classes
19
↳
Endpoints
2
↓ 7 callers
Method
load_font
(self, path: str, allow_missing: bool = False, coordinates: Optional[NormalizedCoords]=None)
fonts.py:58
↓ 6 callers
Method
decode_point
(self, token: int)
font_codec.py:91
↓ 6 callers
Method
encode_point
(self, point: Tuple[int, int])
font_codec.py:33
↓ 6 callers
Method
normalize_font
(self, font: Font)
fonts.py:178
↓ 4 callers
Method
__init__
(self, config: FontogenConfig, font_codec: FontCodec)
model/model.py:158
↓ 4 callers
Method
encode_font
(self, font: Font, limit: int = -1, pad_glyphs: bool = False)
font_codec.py:39
↓ 4 callers
Function
fontogen_config
()
config.py:22
↓ 4 callers
Method
plt_font
(self, font: Font)
fonts.py:255
↓ 3 callers
Method
decode_font
(self, tokens: torch.Tensor)
font_codec.py:98
↓ 3 callers
Method
embed_tokens
(self, text_tokens: torch.Tensor)
model/text_embedding.py:28
↓ 3 callers
Function
font_generator
(font_txt, temperature: int = None, glyphs: str = None, strategy: str = None, checkpoint_pa
server.py:63
↓ 3 callers
Method
sample
(self, text: str, step: int = -1, temperature: int = None, strategy: str = None)
sampler.py:163
↓ 3 callers
Method
tokenize_batch
(self, text_batch: List[str])
model/text_embedding.py:14
↓ 2 callers
Function
create_sampler
( out_folder: str, glyphs: str = None, checkpoint_path: str = 'models/fontogen_78958.c
sampler.py:190
↓ 2 callers
Method
make_a_step
(self, batch)
model/model.py:116
↓ 2 callers
Method
plot_quadratic_bezier_curve
Plot a quadratic Bézier curve given its control points.
fonts.py:191
↓ 2 callers
Method
save_as_ttf
(self, path: str, font: Font)
fonts.py:102
↓ 1 callers
Method
__init__
(self, glyps: str, glyph_res: int)
fonts.py:27
↓ 1 callers
Method
__init__
(self, model: FontogenModule, config: FontogenConfig, out_folder: str, glyphs: str = None)
sampler.py:67
↓ 1 callers
Method
extract_path_data_using_pen
Extract glyph path data using the pen API.
fonts.py:49
↓ 1 callers
Method
find_boundaries
(self, font)
fonts.py:141
↓ 1 callers
Method
font_embeddings
(self, font_tokens: torch.Tensor)
model/model.py:183
↓ 1 callers
Method
font_to_vec
(self, tokens: torch.Tensor)
model/model.py:38
↓ 1 callers
Method
forward
(self, text_embeddings: torch.Tensor, font_tokens: torch.Tensor)
model/model.py:110
↓ 1 callers
Function
generate_font_paragraphs
(glyphs: str, fonts: List[str])
server.py:46
↓ 1 callers
Function
generate_font_styles
(fonts)
server.py:26
↓ 1 callers
Function
main
()
train.py:14
↓ 1 callers
Function
main
()
process_dataset.py:12
↓ 1 callers
Method
plot_cubic_bezier_curve
Plot a cubic Bézier curve given its control points.
fonts.py:199
↓ 1 callers
Method
plot_glyph_from_pen_data
Plot glyph from pen data.
fonts.py:212
↓ 1 callers
Method
record_glyph_paths
(self, glyph_paths: Dict[str, GlyphPaths])
fonts.py:77
↓ 1 callers
Method
sample_font
(self, text_embeddings: torch.Tensor, temperature: int = None, strategy: str = None)
sampler.py:105
↓ 1 callers
Method
sample_next_token
(self, logit: torch.Tensor, strategy: str = 'greedy', temperature: float = 1.0)
sampler.py:83
↓ 1 callers
Method
scale_and_translate_path_data
Scale the path data to fit within the target range, round to integers, and then translate it to make all coordinates non-negative.
fonts.py:158
↓ 1 callers
Function
top_k_top_p_filtering
Filter a distribution of logits using top-k and/or nucleus (top-p) filtering Args: logits: logits distribution shape (vocabulary
sampler.py:36
↓ 1 callers
Method
try_save_font_tokens
(self, font_path: str, font: Font)
sampler.py:180
Method
__getitem__
(self, idx)
dataset/loader.py:23
Method
__init__
(self, glyps: str, glyph_res: int, max_font_tokens: int, max_glyph_tokens: int)
font_codec.py:9
Method
__init__
(self, glyph_res: int)
fonts.py:138
Method
__init__
(self)
fonts.py:187
Method
__init__
(self, config: FontogenConfig, sample_every_epoch: int, out_folder: str)
sampler.py:16
Method
__init__
(self, ds_file, device)
dataset/loader.py:16
Method
__init__
(self, max_text_token_len: int, device: str)
model/text_embedding.py:8
Method
__init__
(self, d_model: int, font_codec: FontCodec, glyph_res: int, max_seq_len: int, device: str)
model/model.py:23
Method
__init__
(self, config: FontogenConfig, dataset_path: str, val_perc=0.04)
model/model.py:69
Method
__init__
(self, config: FontogenConfig)
model/model.py:102
Method
__init__
(self, d_model: int, nhead: int, num_layers: int, text_vocab_size: int, font_vocab_size: int,
model/model.py:192
Method
__len__
(self)
dataset/loader.py:20
Method
close_path
(c)
fonts.py:40
Method
configure_optimizers
(self)
model/model.py:142
Method
cubic_to
(c1x,c1y,c2x,c2y,x,y,c)
fonts.py:36
Method
embed_text
(self, text_batch: List[str])
model/text_embedding.py:37
Method
forward
(self, font_tokens: torch.Tensor)
model/model.py:49
Method
forward
(self, text_embeddings, font_tokens)
model/model.py:186
Method
forward
(self, text_embeddings, font_embeddings)
model/model.py:238
Function
generate
(font_text, selected_model)
server.py:115
Method
line_to
(x,y,c)
fonts.py:34
Method
move_to
(x,y,c)
fonts.py:32
Method
next_idx
()
font_codec.py:45
Method
on_train_epoch_start
(self, trainer: pl.Trainer, pl_module: pl.LightningModule)
sampler.py:23
Method
quadratic_to
(c1x,c1y,x,y,c)
fonts.py:38
Function
refresh
()
server.py:127
Method
test_font_coding_decoding_otf
(self)
tests/test_codec.py:24
Method
test_font_coding_decoding_ttf
(self)
tests/test_codec.py:9
Method
test_font_plotting_otf
(self)
tests/test_fonts.py:46
Method
test_font_plotting_ttf
(self)
tests/test_fonts.py:34
Method
test_font_saving_ttf
(self)
tests/test_fonts.py:8
Method
train_dataloader
(self)
model/model.py:82
Method
training_step
(self, batch: Dict[str, List[str]], batch_idx: int)
model/model.py:128
Method
val_dataloader
(self)
model/model.py:89
Method
validation_step
(self, batch: Dict[str, List[str]], batch_idx: int)
model/model.py:135