dotfiles
bugabingas dorkfiles
owned by bugabinga
wezterm: cleanup code_fonts.csv a little
e70ea9bef74288a974694aec79bd07b048830c4a
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (2)
wezterm/bugabinga/code_font.lua
Modified 1 1 local wez
= require 'wezterm' 2 +local csv_line_pattern
= '^%s*(%d+)%s*,%s*(.-)%s*$' 3 4 local adjust_font_randomness_weight = function ( font_family, adjust )
4 5 local code_fonts
= io.
open( wez.config_dir
.. '/bugabinga/code_fonts.csv',
'r+' )
7 8 for line
in code_fonts:lines()
do 8 - local weight, font_name
= line:match
'^%s*(%d+)%s*,%s*(.-)%s*$' 9 + local weight, font_name
= line:match(csv_line_pattern)
9 10 if not weight
or not font_name
then 10 11 wez.log_error
'Could not parse code_fonts.csv. Borked?' 14 15 if font_name
== font_family
then 15 16 weight
= math.
max(
0, adjust( weight ) )
17 - table.
insert( new_lines, weight
.. ', ' .. font_name )
18 + table.
insert( new_lines, weight
.. ',' .. font_name )
19 20 code_fonts:seek(
'set',
0 )
20 21 for _, new_line
in ipairs( new_lines )
do 80 81 for line
in code_fonts:lines()
do 81 - local weight, font_name
= line:match
'^%s*(%d+)%s*,%s*(.-)%s*$' 82 + print(
'csv line: ' , line)
83 + local weight, font_name
= line:match(csv_line_pattern)
82 84 if not weight
or not font_name
then 83 85 wez.log_error
'Could not parse code_fonts.csv. Borked?' wezterm/bugabinga/code_fonts.csv
Modified 2 -1,
Anonymous Pro Minus 6 -1,
BigBlue TerminalPlus 7 -1,
Bitstream Vera Sans Mono 9 -1,
CMU Typewriter Text 16 -1,
Courier Prime Code 26 -1,
Fantasque Sans Mono 29 -1,
Fixedsys Excelsior 3.01 48 -1,
Latin Modern Mono Light 52 -1,
Linux Libertine Mono 62 -1,
Monaspace Argon Var 63 -1,
Monaspace Krypton Var 64 -1,
Monaspace Neon Var 65 -1,
Monaspace Radon Var 66 -1,
Monaspace Xenon Var 70 -1,
MonteCarlo Fixed 12 71 -1,
NanumGothic_Coding 78 -0,
PixelCarnageMonoTT 93 -1,
Share-TechMonoTrue 98 -1,
Symbols Nerd Font Mono 102 -0,
Verily Serif Mono 6 +1,
BigBlue TerminalPlus 7 +10,
Bitstream Vera Sans Mono 26 +1,
Fantasque Sans Mono 29 +1,
Fixedsys Excelsior 3.01 48 +1,
Latin Modern Mono Light 52 +1,
Linux Libertine Mono 62 +1,
Monaspace Argon Var 63 +1,
Monaspace Krypton Var 65 +1,
Monaspace Radon Var 66 +1,
Monaspace Xenon Var 70 +1,
MonteCarlo Fixed 12 98 +1,
Symbols Nerd Font Mono