« Return to Thread: 'Has Vertical Metrics' is unflagged when loading an SFD

Re: [PATCH] 'Has Vertical Metrics' is unflagged when loading an SFD

by Khaled Hosny-2 :: Rate this Message:

| View in Thread

On Wed, Feb 01, 2012 at 04:54:27PM +0200, Khaled Hosny wrote:

> On Wed, Feb 01, 2012 at 09:17:11PM +0900, MihailJP wrote:
> > Hello,
> >
> > When I was creating a Japanese font, I have found an issue that the 'Has
> > Vertical Metrics' flag turns unset every time I load the SFD, although
> > VWidth
> > property is recorded into each glyph in it.
>
> It seems commit e020d00 that introduced support for BASE table (back in
> 2008) removed the ability to store the 'has vertical metrics' preference
> to SFD files (since it was used for setting vertical origin as well), I
> think it was an oversight and it should be saved (may be under a new
> keyword) in the SFD file. I'm not familiar with vertical stuff, but If
> no one beats me to it, I'll try to do a bit of research and make a
> patch.
The attached patch writes and reads 'Has Vertical Metrics' flag to and
from SFD files.

Regards,
 Khaled


>From e8e97c1da43120dd3bb88383eb8dc0530520be10 Mon Sep 17 00:00:00 2001
From: Khaled Hosny <khaledhosny@...>
Date: Sun, 26 Feb 2012 13:01:48 +0200
Subject: [PATCH] Read/write hasvmetrics flag to SFD files

---
 fontforge/sfd.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/fontforge/sfd.c b/fontforge/sfd.c
index a808973..26c517c 100644
--- a/fontforge/sfd.c
+++ b/fontforge/sfd.c
@@ -1885,6 +1885,8 @@ static int SFD_Dump(FILE *sfd,SplineFont *sf,EncMap *map,EncMap *normal,
  fprintf(sfd, "StrokedFont: %d\n", sf->strokedfont );
     else if ( sf->multilayer )
  fprintf(sfd, "MultiLayer: %d\n", sf->multilayer );
+    if ( sf->hasvmetrics )
+ fprintf(sfd, "HasVMetrics: %d\n", sf->hasvmetrics );
     if ( sf->use_xuid && sf->changed_since_xuidchanged )
  fprintf(sfd, "NeedsXUIDChange: 1\n" );
     if ( sf->xuid!=NULL )
@@ -6662,6 +6664,10 @@ static SplineFont *SFD_GetFont(FILE *sfd,SplineFont *cidmaster,char *tok,
     int temp;
     getint(sfd,&temp);
     sf->hasvmetrics = true;
+ } else if ( strmatch(tok,"HasVMetrics:")==0 ) {
+    int temp;
+    getint(sfd,&temp);
+    sf->hasvmetrics = temp;
  } else if ( strmatch(tok,"Justify:")==0 ) {
     SFDParseJustify(sfd,sf,tok);
  } else if ( strmatch(tok,"BaseHoriz:")==0 ) {
--
1.7.0.4



------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Fontforge-devel mailing list
Fontforge-devel@...
https://lists.sourceforge.net/lists/listinfo/fontforge-devel

 « Return to Thread: 'Has Vertical Metrics' is unflagged when loading an SFD