--- In [EMAIL PROTECTED], Aaron <[EMAIL PROTECTED]> wrote:
> Great I already have fontforge installed and did a converison
although I
> didn't know how to add the unicode stuff or whether to start from a
> type1 or first convert to ttf.

Well, I recommend not converting to ttf, as the extra conversion step
will involve a loss of precision in the curves (ttf and ps use
different equations: quadratic versus cubic). I was surprised to see
that fontforge could convert to SVG, and happy that it worked well.


> > The uploaded file is named feta-font-example.svg. I replaced the
> > fontforge glyph-name attributes with id attributes, so that they
can
> > be referenced in altGlyph elements. Feel free to add unicode
mappings
> > as you determine them necessary. Fontforge can be found at:
> > http://fontforge.sourceforge.net/
> I gather I must add a unicode mapping for each font.
> 
> could you send me one example so that I can proceed on my own with
this?
> I am using fontforge so for instance, I load the feta 20 font that I
> converted to svg, now how do I add the unicode mapping?

Well, after looking at the unicode pages, I would say it will be
difficult, especially since Lilypond and unicode have taken different
approaches to handling notes (lilypond treates the head of the note as
separate from the flag, etc.)

But if you do so, you'll have to manually create a list of unicode
values and corresponding glyph-name from the SVG font. A list of the
glyph-names can be obtained from the SVG font (in a non-XML-aware
fashion) by:

perl -ne 'chomp;($name=$_)=~s/^.*glyph-name=\"([^"]+)\".*$/$1/g;print
$name, "\n" if /glyph-name/;' < font.svg

> Is there a way by command line to do this?
> how do I do this for each charactor in the font? 

Once you create a file of unicode values-> glyph-name mappings, in the
following format:

&#x1d11e;   trebleclef
&#x1d13b;   wholerest

Then you could add those unicode references to the SVG font with
a perl script like the following:

#!/usr/bin/perl -w

use strict;

my (%glyph_map, $uni, $name);

open (FD, "<mappings.txt") || die "Could not open mappings file\n";
while (<FD>) {
  chomp;
  ($uni, $name) = split;
  next if ($uni=~/^$/ || $name=~/^$/);
  $glyph_map{$name} = $uni;
}

while (<>) {
  if (/glyph-name/) {
    chomp(my $glyph=$_);
    $glyph=~s/^.*glyph-name=\"([^"]+)\".*$/$1/;
    my $uni = $glyph_map{$glyph};
    s/(glyph-name=\")([^"]+)(\")/id=\"$glyph\" $1$2$3/;
    if (defined($uni) && $uni!~/^$/) {
      s/(glyph-name=\")([^"]+)(\")/unicode=\"$uni\" $1$2$3/;
    }
  }
  print;
}

  --kirby





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to