|
|
#1 |
|
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 41
Karma: 5514
Join Date: Oct 2009
Location: Groningen, Netherlands
Device: PRS-T1
|
This is how I reduce the font in a lrf file
I am using the Caecilia font and text is too big for me (PRS 505). I use this script to reduce the text by a ratio (85% works for me). Usage is: reducelrs < file.lrs > file_reduced.lrs
Code:
#!/usr/bin/perl -w
use strict;
my $ratio = 0.85;
while(<>) {
if (/fontsize="(\d+)"/) {
my $size = (int($1)*$ratio);
s/fontsize="\d+"/fontsize="$size"/g;
}
print;
}
Code:
mkdir -p done temp
cd temp
for i in ../*lrf;
do cp "$i" .
lrf2lrs *lrf
a=`ls *lrs`
mv "$a" a
reducelrs < a > "$a"
rm a
lrs2lrf *lrs
mv *lrf ../done
rm *
done
cd ..
Tested only in GNU/Linux. I don't know how to do this in Windows. Works for me, but no warranties
Last edited by grimborg; 11-02-2009 at 10:25 AM. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ttc font file can't be put into font folder | droople | Sigil | 2 | 08-21-2010 11:05 AM |
| Embeding font into LRF | nas_matko | Calibre | 28 | 09-21-2009 10:47 AM |
| Bold font in LRF - or just Calibre | FizzyWater | Calibre | 6 | 03-24-2009 04:20 PM |
| feed to lrf, how do I change font (or have default font) | lovemov | Calibre | 3 | 03-16-2009 11:57 PM |
| LRF with embedded font | igorsk | Sony Reader | 8 | 10-26-2006 09:08 AM |