diff -u -r fontforge-20090224/fontforge/charview.c fontforge/fontforge/charview.c --- fontforge-20090224/fontforge/charview.c 2009-02-24 23:23:07.000000000 +0900 +++ fontforge/fontforge/charview.c 2009-03-22 00:29:58.858875000 +0900 @@ -64,7 +64,9 @@ 1, /* show x minimum distances */ 1, /* show y minimum distances */ 1, /* show horizontal metrics */ - 0, /* show vertical metrics */ +// 0, /* show vertical metrics */ + // 20090314: vertical metrics を既定でオンに。 + 1, /* show vertical metrics */ 0, /* mark extrema */ 0, /* show points of inflection */ 1, /* show blue values */ @@ -2126,7 +2128,11 @@ DrawPLine(cv,pixmap,x,y,x+4,y-4,metricslabelcol); DrawPLine(cv,pixmap,x,y2,x+4,y2+4,metricslabelcol); DrawPLine(cv,pixmap,x,y2,x-4,y2+4,metricslabelcol); - dtos( buf, bounds[2]->y-sc->parent->descent); + + // 20090315: bottomSideBearingをちゃんと表示。 +// dtos( buf, bounds[2]->y-sc->parent->descent); + dtos(buf, bounds[2]->y + sc->parent->descent); + y = y + (y-y2-cv->sfh)/2; GDrawDrawBiText8(pixmap,x+4,y,buf,-1,NULL,metricslabelcol); @@ -2139,7 +2145,11 @@ DrawPLine(cv,pixmap,x,y,x+4,y-4,metricslabelcol); DrawPLine(cv,pixmap,x,y2,x+4,y2+4,metricslabelcol); DrawPLine(cv,pixmap,x,y2,x-4,y2+4,metricslabelcol); - dtos( buf, sc->vwidth-bounds[3]->y); + + // 20090315: topSideBearingをちゃんと表示。 +// dtos( buf, sc->vwidth-bounds[3]->y); + dtos(buf, sc->parent->ascent - bounds[3]->y); + x = x + (x2-x-GDrawGetBiText8Width(pixmap,buf,-1,-1,NULL))/2; GDrawDrawBiText8(pixmap,x,y-4,buf,-1,NULL,metricslabelcol); } @@ -2326,9 +2336,15 @@ NULL,_("TopAccent")); } if ( cv->showvmetrics ) { - int len, y = -cv->yoff + cv->height - rint((/*sf->vertical_origin*/-cv->b.sc->vwidth)*cv->scale); - DrawLine(cv,pixmap,-32768,/*sf->vertical_origin*/-cv->b.sc->vwidth, - 32767,/*sf->vertical_origin*/-cv->b.sc->vwidth, + +// int len, y = -cv->yoff + cv->height - rint((/*sf->vertical_origin*/-cv->b.sc->vwidth)*cv->scale); +// DrawLine(cv,pixmap,-32768,/*sf->vertical_origin*/-cv->b.sc->vwidth, +// 32767,/*sf->vertical_origin*/-cv->b.sc->vwidth, + // 20090315: vmetric線の原点を上端にするための変更。 + const int vertical_height = -cv->b.sc->vwidth + cv->b.sc->parent->ascent; + int len, y = -cv->yoff + cv->height - rint(vertical_height * cv->scale); + DrawLine(cv,pixmap,-32768, vertical_height, 32767, vertical_height, + (!cv->inactive && cv->vwidthsel)?widthselcol:widthcol); if ( y>-40 && yheight+40 ) { dtos( buf, cv->b.sc->vwidth); diff -u -r fontforge-20090224/fontforge/cvpointer.c fontforge/fontforge/cvpointer.c --- fontforge-20090224/fontforge/cvpointer.c 2009-01-30 05:59:56.000000000 +0900 +++ fontforge/fontforge/cvpointer.c 2009-03-21 21:57:05.812500000 +0900 @@ -424,8 +424,13 @@ usemymetrics==NULL ) cv->expandedge = ee_right; if ( cv->showvmetrics && cv->b.sc->parent->hasvmetrics && cv->b.container==NULL && - cv->info.y > /*cv->b.sc->parent->vertical_origin*/-cv->b.sc->vwidth-fudge && - cv->info.y < /*cv->b.sc->parent->vertical_origin*/-cv->b.sc->vwidth+fudge ) + +// cv->info.y > /*cv->b.sc->parent->vertical_origin*/-cv->b.sc->vwidth-fudge && +// cv->info.y < /*cv->b.sc->parent->vertical_origin*/-cv->b.sc->vwidth+fudge ) + // 20090314: advanceHeight線の上でカーソルが変わるようにするための修正。 + cv->info.y > -cv->b.sc->vwidth-fudge + cv->b.sc->parent->ascent && + cv->info.y < -cv->b.sc->vwidth+fudge + cv->b.sc->parent->ascent ) + cv->expandedge = ee_down; } } @@ -521,8 +526,14 @@ cv->p.cxb.sc->top_accent_horiz+fs->fudge && cv->b.container==NULL ); dovwidth = ( cv->showvmetrics && cv->b.sc->parent->hasvmetrics && cv->b.container == NULL && - cv->p.cy>/*cv->b.sc->parent->vertical_origin*/-cv->b.sc->vwidth-fs->fudge && - cv->p.cyb.sc->parent->vertical_origin*/-cv->b.sc->vwidth+fs->fudge && +// cv->p.cy>/*cv->b.sc->parent->vertical_origin*/-cv->b.sc->vwidth-fs->fudge && +// cv->p.cyb.sc->parent->vertical_origin*/-cv->b.sc->vwidth+fs->fudge && + // 20090314: advanceHeight線のy原点が箱の上端になるようにするための修正。 + // ここはデータ上のy位置。表示上のy位置はcharview.cのCVExpose函数の最後のほう、 + // 2333行目あたりで処理。 + cv->p.cy>-cv->b.sc->vwidth + cv->b.sc->parent->ascent-fs->fudge && + cv->p.cy<-cv->b.sc->vwidth + cv->b.sc->parent->ascent+fs->fudge && + usemymetrics==NULL ); cv->nearcaret = nearcaret = -1; if ( cv->showhmetrics ) nearcaret = NearCaret(cv->b.sc,cv->p.cx,fs->fudge); diff -u -r fontforge-20090224/fontforge/tottf.c fontforge/fontforge/tottf.c --- fontforge-20090224/fontforge/tottf.c 2009-02-07 08:33:05.000000000 +0900 +++ fontforge/fontforge/tottf.c 2009-03-22 22:09:34.687500000 +0900 @@ -641,7 +641,10 @@ if ( sc->parent->hasvmetrics ) { if ( sc->ttf_glyph<=gi->lastvwidth ) putshort(gi->vmtx,vwidth); - putshort(gi->vmtx,/*sc->parent->vertical_origin-*/b->maxy); + + // 20090314: topSideBearingの修正。これがないと下へ大幅にずれる。 +// putshort(gi->vmtx,/*sc->parent->vertical_origin-*/b->maxy); + putshort(gi->vmtx, sc->parent->ascent - b->maxy); } if ( sc->ttf_glyph==gi->lasthwidth ) gi->hfullcnt = sc->ttf_glyph+1; diff -u -r fontforge-20090224/fontforge/tottfgpos.c fontforge/fontforge/tottfgpos.c --- fontforge-20090224/fontforge/tottfgpos.c 2009-01-30 05:59:57.000000000 +0900 +++ fontforge/fontforge/tottfgpos.c 2009-03-21 23:22:50.859375000 +0900 @@ -1838,30 +1838,33 @@ } static void dumpGSUBsimplesubs(FILE *gsub,SplineFont *sf,struct lookup_subtable *sub) { - int cnt, diff, ok = true; +// int cnt, diff, ok = true; + int cnt; int32 coverage_pos, end; SplineChar **glyphs, ***maps; glyphs = SFOrderedGlyphsWithPSTinSubtable(sf,sub); maps = generateMapList(glyphs,sub); - diff = (*maps[0])->ttf_glyph - glyphs[0]->ttf_glyph; - for ( cnt=0; glyphs[cnt]!=NULL; ++cnt) - if ( diff!= maps[cnt][0]->ttf_glyph-glyphs[cnt]->ttf_glyph ) ok = false; - - if ( ok ) { - putshort(gsub,1); /* delta format */ - coverage_pos = ftell(gsub); - putshort(gsub,0); /* offset to coverage table */ - putshort(gsub,diff); - } else { + // 20090315: GSUBでdeltaを使うと少なくともXPでは縦書きにならん。 + for ( cnt=0; glyphs[cnt]!=NULL; ++cnt); // これだけはcntのため要る。 +// diff = (*maps[0])->ttf_glyph - glyphs[0]->ttf_glyph; +// for ( cnt=0; glyphs[cnt]!=NULL; ++cnt) +// if ( diff!= maps[cnt][0]->ttf_glyph-glyphs[cnt]->ttf_glyph ) ok = false; + +// if ( ok ) { +// putshort(gsub,1); /* delta format */ +// coverage_pos = ftell(gsub); +// putshort(gsub,0); /* offset to coverage table */ +// putshort(gsub,diff); +// } else { putshort(gsub,2); /* glyph list format */ coverage_pos = ftell(gsub); putshort(gsub,0); /* offset to coverage table */ putshort(gsub,cnt); for ( cnt = 0; glyphs[cnt]!=NULL; ++cnt ) putshort(gsub,(*maps[cnt])->ttf_glyph); - } +// } end = ftell(gsub); fseek(gsub,coverage_pos,SEEK_SET); putshort(gsub,end-coverage_pos+2);