xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henning von Bargen <H.vonBar...@Triestram-Partner.de>
Subject AW: AW: Reverse XSL:FO
Date Sat, 22 Apr 2000 08:02:52 GMT
> -----Urspr√ľngliche Nachricht-----
> Von:	Stefano Mazzocchi [SMTP:stefano@apache.org]
> Gesendet am:	Donnerstag, 20. April 2000 23:05
> An:	general@xml.apache.org
> Betreff:	Re: AW: Reverse XSL:FO
> 
> Henning von Bargen wrote:
> > 
> > There's a tool called ps2edit (an extension to ghostscript) that
promises
> > to convert files from PS or PDF to SVG, but I didn't test it.
> > >From SVG, why should you then want to use XSL:FO ?
> > SVG is a XML format in itself and you can use XSL to do whatever you
want.
> 
> Like, for example, do neural OCR on the SVG vectors to get FO text using
> XSLT stylesheets? good luck :)

Why would this be necessary? SVG stores text elements as text, see some
examples
at http://www.adobe.com/web/features/svg/samples.html
for example this one (etchedGlass.svg), which displays the letters SVG with
a lot of
effects added (notice the <text> element at the bottom of the source):

<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 03December 1999//EN"
"http://www.w3.org/Graphics/SVG/SVG-19991203.dtd">
<svg xml:space="preserve" width="3in" height="2in">
<defs>
  <filter id="EtchedGlass" filterUnits="objectBoundingBox" x="-10%" y="-10%"
width="120%" height="120%">
  <!--Copyright 1999 Adobe Systems. You may copy, modify, and distribute
this file, if you include this notice & do not charge for the distribution.
This file is provided "AS-IS" without warranties of any kind, including any
implied warranties.-->
    <feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/>
    <feOffset in="blur" dx="10" dy="8" result="offsetBlurredAlpha"/>
    <feSpecularLighting in="blur" surfaceScale="5" specularConstant="1"
specularExponent="7" lightColor="white" result="specularOut">
      <fePointLight x="-5000" y="-10000" z="20000"/>
      </feSpecularLighting>
    <feTurbulence type="turbulence" baseFrequency="0.01" numOctaves="10"
result="turb"/>
    <feColorMatrix type="matrix" in="turb" result="turbulence" values="1 0 0
0 0  1 0 0 0 0  1 0 0 0 0  0 0 0 0 1"/>
    <feComposite in="turbulence" in2="specularOut" operator="in"
result="specularOut"/>
    <feComposite in="specularOut" in2="SourceAlpha" operator="in"
result="specularOut"/>
    <feComposite in="SourceGraphic" in2="specularOut" operator="arithmetic"
k1="0" k2="1" k3="1.5" k4="-.5" result="litPaint"/>
    <feColorMatrix type="matrix" in="litPaint" result="litPaint" values="1 0
0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 0 .6"/>
    <feComposite in="litPaint" in2="SourceAlpha" operator="in"
result="litPaint"/>
    <feMerge>
      <feMergeNode in="offsetBlurredAlpha"/>
      <feMergeNode in="litPaint"/>
      </feMerge>
    </filter>
  <linearGradient id="relativeLinear" gradientUnits="objectBoundingBox"
x1="0" y1="1" x2="0" y2="0">
    <stop offset="0" style="stop-color:wheat"/>
    <stop offset="1" style="stop-color:skyblue"/>
    </linearGradient>
  </defs>
<g>
  <image style="opacity:.3" x="0" y="0" width="400" height="200"
xlink:href="snowboard.jpg"/>
  <text x="20" y="150"
style="opacity:.7;font-family:'Times';font-size:180;filter:url(#EtchedGlass)
;fill:url(#relativeLinear)">SVG</text>
  </g>
</svg>


> 
> Converting PS to FO is not different from converting JPG to MathML, or
> WAV to VoxML. 
> 
> XSLT is great but not magic :)
> 
> -- 
> Stefano Mazzocchi      One must still have chaos in oneself to be

Hey Stefano, you're right!
It's impossible (or at least, very very very difficult) to do such things
with pure XSLT or FO.
But theoretically, one could use an external program to do voice2text
recognition and
let it generate a text file, this could be included via uri:include ;-)


Mime
View raw message