resizing custom fonts

Hi,

I have a custom font, which I am sizing for my displays.  The problem is that some of the newer VENU watches have such high resolution that the font appears significantly smaller and hence less legible, than on other watches.  Is there a fix for this?  Some way that can make the font appear 60 pixels wide instead of 30, or would that involve using an entirely different font for those watches?

thanks in advance for any tips

  • Or ast lease a list of a s possible syntax (resource-[round/rectangle]-[sizeX]x[sizeY])? I think there are other combinations that can be used?

    Open {SDK_FOLDER}/bin/default.jungle and search for "family qualifier".

    e.g.

    # Set the round-260x260 family qualifier
    round-260x260 = $(round)
    round-260x260.resourcePath = $(round-260x260.resourcePath);resources-round-260x260

    Understand that for this all to work, jungles are not needed,  Works fine if you just have the resources for

    resources-round-260x260

    in a folder called resources-round-260x260 at the same level as resources

    Thanks but I never said (custom) jungles were needed? ronnywinkler asked if there was a list of possible resource qualifiers and I pointed him to where it is. Do you actually read comments in full (and also look at context / quotes / what ppl are replying to) or do you just scan them for keywords and react to what you think people said?

    I'm not sure there is a list anyplace, in fact the one I posted a couple years back has more devices now.  There I used

    resources-<shape>-<size>

    So like with the Instinct2, it was just

    resources-semioctagon-176x176

    I find it hilarious that you would expect people to guess that semioctagon is a possible resource qualifier, without pointing to the corresponding documentation somewhere. Besides default.jungle, device screen shapes and resolutions can be found here:

    https://developer.garmin.com/connect-iq/reference-guides/devices-reference/

    I still think default.jungle is the *definitive* resource for all the qualifiers. For example, the list linked above says that Descent G1's screen shape is "semi-octagon", but of course if you use the resource qualifier, it's spelled "semioctagon". How exactly would a dev know that unless they guess or they look at default.jungle?

    Here is the official documentation on default.jungle.

    https://developer.garmin.com/connect-iq/reference-guides/jungle-reference/

    The Default Jungle File

    The Connect IQ SDK includes a default Jungle file, which is always applied to projects even if no custom Jungle files are present. It defines a base qualifier, which represents all source files (.mc) contained in the project, and all resource files found in the resources at the root of a Connect IQ project. It also defines default device, family, and language qualifiers that are the basis for the qualifier scheme described in the previous section.

    When a project is built, the instructions from the default Jungle file are applied first, then any instructions from custom Jungle files are applied. This makes it possible for customizations to override the default build instructions.

  • Sorry for the late answer. Thanks for the detailled information, . I will check the file if it's providing the possible resource options. That will help me a lot. And the device reference is a good point to get the resolution (if the resource path syntax in known). I hoped, Garmin would add such information in the SKD manual.

    I know I can use round/rectangke and resolution in resource paths, but wondered if there are other combinations like resource-<size> or other kinds of differences. Perhaps I find something in the jungle file.

     You are right. I was searching for a resource path solution, because that's the easiest way to do this. I used jungle files to define a second code version for low memory devices, but for such things like fonts it's much clearer with resources.

  • I hoped, Garmin would add such information in the SKD manual

    Yeah, personally I think the documentation leaves a lot to be desired. There's a few things which the docs only imply and/or which can only be discovered through trial and error or by reading the forums.

    I know I can use round/rectangke and resolution in resource paths, but wondered if there are other combinations like resource-<size> or other kinds of differences.

    The docs actually cover this. (resource-{size} isn't a built-in format, so if you want to have a common folder for rectangle-240x240 and round-240x240, you'll have to define it yourself in a jungle.)

    TL;DR the only built-in resource formats are:

    - resources (default resource path)

    - resources-{device}: e.g. resources-fenix5

    - resources-{screen_shape}: e.g. resources-round

    - resources-{screen_shape}-{screen_size}: e.g. resources-round-218x218

    - resources-{language}: e.g. resources-fre

    - resources-{device}-{language}: e.g. resources-fenix5-fre

    - resources-{screen_shape}-{language}: e.g. resources-round-fre

    - resources-{screen_shape}-{screen_size}-{language}: e.g. resources-round-218x218-fre


    [https://developer.garmin.com/connect-iq/core-topics/build-configuration/]

    Build Configuration

    Connect IQ supports a wide variety of Garmin devices, like watches, bike computers and handhelds. Even within these broader categories, devices can have different screen sizes, shapes and resolutions. Application developers may wish to define specific resources, like fonts and bitmap graphics, for certain devices or device families for a better user experience. For example, an app may need to use a round background image for round devices and a square background image for square devices.

    Connect IQ offers a few ways to manage app resources: device and family qualifiers, Jungles and build exclusions.

    Device, Family, and Localization Qualifiers

    The simplest way to override resources is with device, family, and localization qualifiers, which are added to a resources folder by adding a hyphen (-) followed by a valid qualifier value. Let’s take a look at an example:

    Figure 1: A project that uses a fēnix 5 device resource qualifier

    Resource qualifiers are applied to the base resources folder, and all resources found within that folder will inherit the qualifiers of the base folder. Resources with more specific qualifiers will always take precedence over less specific ones if they share a resource ID.

    In Figure 1, the resources-fenix5 directory uses a -fenix5 qualifier to segregate resources specifically intended for the fēnix 5. When this project is built for fēnix 5, the layout and drawable in the resources-fenix5 directory will be used to display a different background image than the one in the more generic resources directory. All other supported products will compile with the default resources.

    Note: Multiple qualifiers separated by hyphens may be used on a single folder, but device qualifiers are not allowed to co-exist with family qualifiers in the same folder name (e.g. resources-round-fenix3) and will be skipped by the resource compiler if encountered.

    Device Qualifiers

    The device qualifier format allows for resources to target specific devices (as demonstrated in Figure 1). Resources included in a folder with a device qualifier will override the resources with the same ID that are defined in the base resource folder when building for the associated device. Device qualifiers also take precedence over less specific qualifiers, such as family qualifiers.

    Family Qualifiers

    The family qualifier format allows for resources to target specific device families, which is a group of devices differentiated by shared screen characteristics. There are two family qualifiers:

    • Screen shape: The shape of the screen (e.g. round, rectangle, etc.)
    • Screen size: The physical size of the screen in pixels ( e.g. 218x218, 148x205, etc.)

    The screen shape must always be specified when using a family qualifier, and the screen size may be added to further refine the target family. Here are some examples of valid and invalid family qualifier examples:

    • resources-round: Valid—targets round screen devices, like the fēnix 3 series and fēnix 5 series
    • resources-round-218x218: Valid—targets 218px x 218px, round screen screen devices, like the fēnix 3 and fēnix 5S (but not the 5 or 5X since they have 240px x 240px screens)
    • resources-218x218: Invalid—this will be ignored by the resource compiler because no screen shape has been specified
    • resources-218x218-round: Invalid—the screen shape was not specified first

    Resources with more specific qualifiers will always take precedence over less specific ones, so on a round, 218px x 218px device, any resources contained in the resources-round-218x218 resources folder will be used in place of those in resources-round if they share an ID. In addition any resource folder that carries a family qualifier will always defer to resource folders named with device qualifiers.

    Localization Qualifiers

    Localization qualifiers are a way to specify language-specific string resources, and are specified as an ISO 639–2 language code. These qualifiers may be combined with either device or family qualifiers, and are always specified last in the qualifier naming scheme. For example:

    • resources-fre: Provides French language-specific string resources for all devices
    • resources-round-fre: Provides French language-specific string resources for round devices only
    • resources-fenix5s-fre: Provides French language-specific string resources for fēnix 5 devices only
  • Many thanks again. The resource formats are at least something I really missed in the SDK manual.

  • Many thanks again. The resource formats are at least something I really missed in the SDK manual.

    No worries! Maybe they don't want to explicitly document it bc it will quickly be out of date. That is another problem which comes up quite often in the SDK doc (especially when you look at "Supported Devices" for various API functions)

    BTW: I used the following command in WSL (linux on Windows) to get a list of resource formats in alphabetical order. Should work just as well on real linux or Mac:

    grep "resourcePath =" default.jungle | sed s/.*\;// | sed s/.*\=\ // | sort

    Output:

    resources
    resources-approachs60
    resources-approachs62
    resources-d2air
    resources-d2airx10
    resources-d2bravo
    resources-d2bravo_titanium
    resources-d2charlie
    resources-d2delta
    resources-d2deltapx
    resources-d2deltas
    resources-d2mach1
    resources-descentg1
    resources-descentmk1
    ...