size - Fabric js Itext box sizing issue with custom fonts -
i have issue fabircjs itext box sizing custom fonts.
- goldsaber
- earwig factory
when choose 1 of above mentioned fonts text box size bigger default text "vloz text"(there space @ end of text , box border), standart font, example "arial" text feets text-box(there isn't mentioned space). in case of "goldsaber" text-box size gets bigger , bigger text (mentioned space gets bigger). want behave same way arial. means text-size should feet text-box without space between last character of text , text-box border.
javascript: var canvas = window._canvas = new fabric.canvas('c'); addtext("vlož text", "arial", 50, 50); addtext("vlož tssssssssssssssssext", "arial", 50, 250); addtext("vlož text", "goldsaber", 100, 50); addtext("vlož tssssssssssssssssext", "goldsaber", 100, 250); addtext("vlož text", "earwig factory", 150, 50); addtext("vlož tssssssssssssssssext", "earwig factory", 150, 250); function addtext(text, font, top, left) { var text = new fabric.itext(text, { fontfamily: font, fontsize: 25, top: top, left: left, originy: 'top', originx: 'left', padding: 0, lineheight: 0.9, transparentcorners: false }); canvas.add(text); } html: <canvas id="c" width="600" height="600"></canvas>
here jsfiddle: https://jsfiddle.net/13zgk2fs/12/
to see problem please install above mentioned fonts locally. had problems set-up custom fonts in jsfiddle.
look https://github.com/kangax/fabric.js/issues/3588 . if correctly understood - same problem
Comments
Post a Comment