renderer fonts: additions and improvements

* Allow passing font options to renderer.font:copy().
* Added renderer.font:get_path()
* Reintroduced set_size() for more faster font size changes
* Swapped copy wiht set_size on scale plugin for better performance
* Use code_font:copy() instead of renderer.font.load() on language_md to
  properly match user font now that font options are supported on copy.
* Added new changes to renderer docs
This commit is contained in:
jgmdev
2022-06-23 18:08:04 -04:00
parent 31d2024283
commit d2f9eeea07
6 changed files with 146 additions and 50 deletions
+1 -3
View File
@@ -14,9 +14,7 @@ for _, attr in pairs({"bold", "italic", "bold_italic"}) do
attributes["bold"] = true
attributes["italic"] = true
end
-- no way to copy user custom font with additional attributes :(
style.syntax_fonts["markdown_"..attr] = renderer.font.load(
DATADIR .. "/fonts/JetBrainsMono-Regular.ttf",
style.syntax_fonts["markdown_"..attr] = style.code_font:copy(
style.code_font:get_size(),
attributes
)