#!/bin/sed -f # ------------------------------------------------ # Copyright (C) 2011 @kabipanotoko # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ------------------------------------------------ # /^%%EndProlog$/ i\ % inserted by emph.sed\ /F { fontsize mul scalefont setfont} def % switch font: ex: mincho 1.1 F\ /L { neg okuri mul currentpoint 2 index add moveto pop } def % widen or shorten line spacing: ex: 1.5 L\ /2LCS { -0.5 L } def % 2L center start\ /2LCE { 0.5 L } def % 2L center end\ /W { fontsize mul currentpoint exch 2 index add exch moveto pop } def % widen or shorten line spacing: ex: 1.5 W\ /(.*)/ { s/<[Gg]>/) show gothic 1 F (/g s/<\/[Gg]>/) show dfont 1 F (/g s/<\([0-9.][0-9.]*\)[Gg]>/) show gothic \1 F (/g s/<\/[0-9.]*[Gg]>/) show dfont 1 \F (/g s/<[Mm]>/) show mincho 1 F (/g s/<\/[Mm]>/) show dfont 1 F (/g s/<\([0-9.][0-9.]*\)[Mm]>/) show mincho \1 F (/g s/<\/[0-9.]*[Mm]>/) show dfont 1 \F (/g s/<[Dd]>/) show dfont 1 F (/g s/<\([0-9.][0-9.]*\)[Dd]>/) show dfont \1 F (/g s/<\([+-]\{,1\}[0-9.][0-9.]*\)[lL]>/) show \1 L (/g s/<2[Ll][Cc]>/) show 2LCS (/g s/<\/2[Ll][Cc]>/) show 2LCE (/g s/<\([+-]\{,1\}[0-9.][0-9.]*\)[wW]>/) show \1 W (/g }