Font problem in svg

Home Forums Programming Font problem in svg

This topic contains 5 replies, has 2 voices, and was last updated by Yuri Kovelenov Yuri Kovelenov 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #18739
    Avatar
    HoboCat
    Licensee

    Hello,
    Im making engraved products simulation project. Its almost done but a few small problems are left to cope with.

    I am usind replace_texture puzzle to change an existing texture, with new one from browser (svg with user customized content). Everything works fine, but verge 3d does not show correct font from svg.

    To load font in svg I use these lines in svg file:

    The font “CF One Two Trees.woff” is taken from server and svg is showed with correct font in browser. But when I pass this svg to verge3d it loads svg with default fonts, unless I have this font installed in my pc, then its ok.

    I have tried putting font in v3d app folder and loading it with “load font” puzzle, but it seems that this puzzle is suited for other purposes and doesnt work on my situation.

    Is there any way I can load that font with verge3d?

    • This topic was modified 1 month ago by Avatar HoboCat.
    #18744
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    Hi,

    I pass this svg to verge3d it loads svg with default fonts

    How do you use SVG in Verge? Got a link or may you can share a simple project that shows the issue?

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #18769
    Avatar
    HoboCat
    Licensee

    Basicaly I add svg outerHTML into input. And on event of click verge puzzles takes value from input and uses it tu replace the existing texture. There are some minor changes that must be done for svg to be used this way: ‘#’ replaced with ‘%23’, images in svg must be in base64 format.

    Attachments:
    You must be logged in to view attached files.
    #18794
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    I suggest you try to embed your font in SVG in base64 format too
    https://stackoverflow.com/questions/26867893/converting-and-rendering-web-fonts-to-base64-keep-original-look

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #18893
    Avatar
    HoboCat
    Licensee

    base64 solved it! Thank you!

    #18903
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    excellent! :bye:

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.