Courier Font
1234567890
abcdefghij
until file.eof?
case file.read(1)
when "\n"
if (new_line_count = 0)
new_line_pos = file.pos - 1
new_line_count += 1
end
when "#"
sharp_pos = file.pos - 1 if sharp_pos == -1
when "$"
dollar_pos = file.pos - 1 if dollar_pos == -1
end
break if sharp_pos > 0 and dollar_pos > 0 and new_line_count > linenum
end
if (sharp_pos >= 0 and dollar_pos > 0)
file.seek(sharp_pos, IO::SEEK_SET)
puts file.read(dollar_pos - sharp_pos + 1)
end
Courier New Font 로 하니까 되긴 되네. 다만, 전체 셀렉트해서 폰트 지정해야 될 듯.
https://nanikit.github.io/dc-highlighter/
깃헙갤 유저가 예전에 코드 하이라이터 만들었네. 이거 쓰면 잘됨