@Claudia-Svenson said in How to increase font-size of marked text by 1 pixel?:
I need no zoom to view the text but I need to increase font for PRINTING it.
Any solution for that?
PythonScript plugin might help to make printing with a preferred text size easier.
# https://community.notepad-plus-plus.org/topic/23039/faq-how-to-install-and-run-a-script-in-pythonscript/1
from Npp import editor, notepad
def doPrint():
lang = notepad.getLangType()
if lang == LANGTYPE.TXT:
STYLE_DEFAULT = 0
STYLE_LINENUMBER = 33
# Set print size
PRINT_SIZE = 10
# Get current sizes
default_size = editor.styleGetSize(STYLE_DEFAULT)
line_size = editor.styleGetSize(STYLE_LINENUMBER)
# Set print sizes
editor.styleSetSize(STYLE_DEFAULT, PRINT_SIZE)
editor.styleSetSize(STYLE_LINENUMBER, PRINT_SIZE)
# Print the doc
notepad.menuCommand(MENUCOMMAND.FILE_PRINT)
# Restore sizes
editor.styleSetSize(STYLE_DEFAULT, default_size)
editor.styleSetSize(STYLE_LINENUMBER, line_size)
else:
notepad.messageBox('Language type {} not setup for printing'.format(lang))
doPrint()
PRINT_SIZE is set to 10 for printing and will restore to previous size after print is done.
This is just setup for text files which only have default style 0. Other language types may have many styles and might be complex to setup for printing.
PythonScript configuration can set the script as a toolbar icon for quick access.
Tested with XPS document writer as have no actual printer.