Acknowledged
over 1 year ago

dc.drawAngledText() Symbol Not Found Error on Venu 3 and Venu 3s

Example:

if(dc has :drawAngledText)
{
    dc.drawAngledText(x, y, font2, text2, Gfx.TEXT_JUSTIFY_LEFT, 90);
}

On other watches like Forerunner 955, it draws the text.  On other watches that don't support drawAngledText(), it doesn't try to draw the angled text.  But on Venu 3, it tries to call dc.drawAngledText() but gets an error:

Error: Symbol Not Found Error

Details: Failed invoking <symbol>

This happens on hardware as well as simulator.

The documentation says it should work on Venu 3, so the if(dc has :drawAngledText) condition is expected to be true on Venu 3, but it should be able to successfully draw the text.

  • Thanks for the help.  My problem was that I was using "BionicBold" which isn't supported on Venu 3.  I was handling that by using a non-scalable font instead, so it wasn't a null font, but wasn't scalable so it wouldn't work with drawing angled text.

    I added a list of faces to choose from as you suggested so it can find a different scalable font if BionicBold isn't available.  I also added a check so I don't try to draw angled text if it is using a non-scalable font.

  • By the way one way to hanlde this is to replace line 3 in the onLayout with this:

    font=Graphics.getVectorFont({:face=>["BionicBold","RobotoItalic"], :size=>sz});
    The 965 has "BionicBold" while the venu3 doesn't.
    So on a 965, "font" uses "BionicBold" while on the venu3, font is "RobotoItalic" as it doesn't have "BionicBold"
    You can see what's supported by looking in simulator.json for a device. and look for (with the 965)
    stuff like this:
                    {
                        "filename": "Bionic_Bold",
                        "name": "BionicBold",
                        "type": "system_ttf"
                    },

    (system_ttf is the key)
  • But passing a null font produces a different error.

    e.g.

    dc.drawAngledText(120, 120, Graphics.getVectorFont({:face => "badfontname", :size => 20}), "hello", Graphics.TEXT_JUSTIFY_LEFT, 45);

    Error: Unexpected Type
    Error Details: Failed invoking <symbol>

    However, the following code works in the CIQ 6.3.1 simulator for me, with venu3 and fr955 devices:

    dc.drawAngledText(120, 120, Graphics.getVectorFont({:face => "RobotoCondensedBold", :size => 20}), "hello", Graphics.TEXT_JUSTIFY_LEFT, 45);
  • Not all vector fonts are available on all devices, so it may be your font2 is null

  • Could it be the fonts you are trying to use?

    Here's some bits from one of my test apps and it runs in the sim for the venu3.

    First, I check if Vector Fonts are available in initialize:

    hasVF=(Toybox.Graphics has :getVectorFont);
    Then in onLayout, I load 2 fonts if I can:
        if(hasVF) {
            var sz=(height*.35).toNumber(); 
            font=Graphics.getVectorFont({:face=>"RobotoItalic", :size=>sz});
    
            sz=sz/2;
            fontS=Graphics.getVectorFont({:face=>"RobotoCondensedBold", :size=>sz});
            System.println(sz);
        }
    Then in onUpdate, I use those two fonts if available:
            dc.setColor(Graphics.COLOR_WHITE,Graphics.COLOR_BLACK);
            if(font!=null) {
                dc.drawText(width/2,height/2,font,"ABC",Graphics.TEXT_JUSTIFY_CENTER|Graphics.TEXT_JUSTIFY_VCENTER);
            }
            if(fontS!=null) {
                dc.drawRadialText(width/2, height/2, fontS, "1234567", Graphics.TEXT_JUSTIFY_CENTER, 45, width/2-(height*.15), Graphics.RADIAL_TEXT_DIRECTION_CLOCKWISE);
            
                dc.drawAngledText(width/2, height*.8, fontS, "hello", Graphics.TEXT_JUSTIFY_CENTER, 250);
            }
    And here is a screen shot from the sim: