We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Font problem in svg

Home Forums Programming Font problem in svg

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

    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:

    <defs>
      <style type="text/css">
        @font-face {
          font-family: CF One Two Trees;
          src: url('{{url_for('static', filename='fonts/CF One Two Trees.woff')}}');
        }
      </style>
    </defs>

    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?

    #18744

    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?

    Chief 3D Verger | LinkedIn | Twitter

    #18769
    HoboCat
    Customer

    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.

    #18794

    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

    Chief 3D Verger | LinkedIn | Twitter

    #18893
    HoboCat
    Customer

    base64 solved it! Thank you!

    #18903

    excellent! :bye:

    Chief 3D Verger | LinkedIn | Twitter

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.