[TxMt] Re: Printing vs Viewing Font

Hans-Jörg Bibiko bibiko at eva.mpg.de
Sun Nov 2 01:10:52 UTC 2008

On 01.11.2008, at 23:21, Marc Feldesman wrote:

> I'm having a bit of trouble balancing the the size of the print  
> font with the size of the font visible on the screen.  The print  
> font is way too large to fit comfortably on a standard sheet of  
> paper, but it appears that in order to reduce the printing font I  
> also have to reduce the size of the font on the screen.  Is there  
> some way to decouple these two font sizes and types?  I'd like the  
> print font to be no more than 9 or 10 point, while the on screen  
> font I'd like to keep at 13 or 14 point.  I've got a 30" monitor  
> and screen real estate is no problem.  I have old eyes, but I don't  
> like to waste paper or have ugly printouts.
> Any suggestions on how to resolve this.  I don't see anywhere to  
> decouple these two fonts.

As far as I know up to now the Print command will use only the  
document font size.
But there are some workarounds.

- invoke the command "Create HTML From Document" or "Create HTML From  
Document With Line Numbers" in the TextMate bundle
- you'll get a new doc containing an HTML representation of the your doc
- here you can change the font-size/family manually (line 22 and 23)
- press CTRL+OPT+APPLE+P to open the Web Preview
- press CTRL+P for printing

This can also be automated:
-open the Bundle Editor, select TextMate > "Create HTML From  
Document", and add e.g.:

.gsub(/font-size:.*/,'font-size: 9pt;')

to the line:
print document_to_html( STDIN.read, :include_css => !ENV.has_key? 

to get

print document_to_html( STDIN.read, :include_css => !ENV.has_key? 
('TM_SELECTED_TEXT') ).gsub(/font-size:.*/,'font-size: 9pt;')

-close the Bundle Editor
-invoke that command
-you get a new doc and press CTRL+OPT+APPLE+P
-you'll see your doc in the Web Preview and press APPLE+P for printing

An other way is to use a2ps if installed:
details: http://lists.macromates.com/textmate/2006-April/009412.html


More information about the textmate mailing list