popplerでのworkaround
Annot::layoutTextから呼んでいるCharCodeToUnicode::mapToCharCodeの中で, Cmapから対応する番号を探しているのだけど, これでU+0020やU+3000が番号を返さなくて困っている様子。 そこで適当にU+0020には1,U+3000には633を返してやることで, とりあえず空白はそれっぽく表示できるようになった。 633という数は…無理やり探しあてた。 いろいろ妙なところはあるけどまあ自分で使う分にはいいか。 備忘録的にパッチを残しておく。
Dict *fontDict = new Dict(xref);
+ Dict *subfontDict = new Dict(xref);
+ Dict *cidSystemInfo = new Dict(xref);
+ Array *widthArray = new Array(xref);
+ Array *descArray = new Array(xref);
Dict *fontsDict = new Dict(xref);
// Set font state
appearBuilder.setDrawColor(da.getFontColor(), true);
appearBuilder.setTextFont(da.getFontName(), da.getFontPtSize());
int i = 0;
return 1;
}
}
+ if(*u == 0x0020){*c = 1; return 1;}
+ if(*u == 0x3000){*c = 633; return 1;}
*c = 'x';
} else {
int i, j;