Release notes: Embedded Wizard 14

Version 14 contains the following changes and improvements:

Add support for SVG (Scalable Vector Graphics)

Embedded Wizard has been enhanced by new SVG resource and SVG view. Both provide functionality to manage and display SVG image files in Embedded Wizard projects. SVG files define image contents in vector graphics format stored as XML text. Being described by vectors SVG images can be scaled in size and rotated without loss of quality and without presenting any ugly scaling effects as it is the case when using pixel based bitmap resources.

Diverse SVG images displayed in Embedded Wizard. The orange icon in the upper-right corner is a variant of the official logo for SVG (Scalable Vector Graphics) file format standard and is subject to W3C Document license conditions.

Usually, SVG images also occupy less memory compared with pixel bitmap resources. The larger the bitmap, the bigger the expected benefit of the SVG file. On the other hand, processing SVG contents require much more CPU power and, depending on the SVG content, also RAM to store intermediate image contents. The SVG resources are therefore not seen as replacement for bitmap resources. More than that, they should be considered as a complement for bitmap resources and it's up to you to decide in which application case it is appropriate to use a bitmap or SVG resource.

During code compilation the SVG files are automatically converted in a format optimized for the particular target system. It includes compression of vector data and elimination of superfluous and not supported SVG elements. Similar to other resource types, SVG resource members can also be localized with several image files, one for every supported language. This capacitates the SVG resource to automatically offer the image corresponding to the currently selected language.

While SVG resources are converted at the code generation time and later they are immutable, a new Mosaic class SVG Data allows the processing of dynamically obtained SVG images. That means, if the SVG image has been read from an SD card or received via network, SVG Data can process the SVG image at the runtime, which then can be displayed by using the SVG view.

To close the gap between the new SVG functionality and the old pixel bitmap resources, a further Mosaic class SVG Bitmap is available. Objects of this class act as off-screen bitmaps where SVG contents are rendered. The resulting bitmap can then be used wherever the older bitmaps are expected, for example, as icon in a Push Button widget.

IMPORTANT

SVG specification and the feature set are very extensive. The authors of Embedded Wizard have therefore decided to support only a subset of the entire SVG functionality carefully considering which features are useful and practical on less powerful embedded systems. For complete compatibility overview, please see the section SVG versions and compatibility.

Add support for more complex (e.g. radial) color gradients

Originally Embedded Wizard supported so-called 4-point gradients. This means that user could specify for each rectangular view four different colors, one color for each corner. The content of the view was then displayed by interpolating the colors between the corners. In many cases this approach is sufficient as well as it is well optimized for different target systems even not providing any dedicated graphics hardware acceleration.

In cases your application case requires more complex gradients, two new Mosaic classes have been added. With Linear Gradient you configure a complex gradient which spreads along a straight line segment. Radial Gradient, in turn, is suitable to configure gradients where the colors spread along a circle. In both cases, the gradient can accommodate up to 256 different so-called color stops, each specifying a color value and position inside the gradient.

To display the gradients, new Filled Gradient Path and Stroked Gradient Path views are available. The views are optimized to fill or stroke a shape composed of vectors by using the predetermined gradient.

Filled Gradient Path and Stroked Gradient Path views displaying complex gradients

Enhancement of Font resources to support vector font data

The Quality attribute available in Font resources has been enhanced by new option Vector. Using this option, the font glyphs are stored as vector data. The vector data is rasterized at the runtime when corresponding glyph is acquired. Unlike other Quality options, Vector allows the glyphs to be scaled dynamically at the runtime of the application. This can reduce the ROM footprint, especially if an application is using many different variants of one and the same font.

IMPORTANT

This new option can be seen as a partial replacement for a TrueType Font Engine in the target system. It requires few resources and is optimized for targets with less CPU power. On the other hand, it does not support all TrueType features. Especially, hinting is omitted resulting in small glyphs looking blurry compared with similar glyphs rasterized by TrueType Font Engines.

With this modification, the management of Font resources have been redesigned. Now, the font data is shared between multiple Font resources as good as possible. For example, if your application contains two similarly configured Font resources, only one data set is generated. In version <= 13, such project would produce duplicates of the same font data.

Furthermore, the attribute Quality can now be configured individually for each language variant in the font. Originally, the quality of an entire font resource was imposed by the highest quality option specified in one of the language variants in the resource. Now one font resource may combine fonts with different qualities. Even mixing pre-rasterized glyphs and vector data is possible.

CAUTION

The extraction and usage of font vector data found originally inside a TrueType font may eventually expect you to acquire a dedicated license of the respective font. Embedded Wizard limits to provide the technology to perform the font conversion and is not responsible for font license specific aspects.

Add support for constants and resources in separate (Blob) files

Before version 14 constants and resources were stored inside the generated code. After compiling the generated code, the corresponding data became a fixed part of the resulting binary (the application). This is a simple and convenient approach to deal with constants and resources. A disadvantage of this approach is that it was inevitable to rebuild the entire binary when constants or resources changed. Simply exchanging the data retrospectively without modifying the binary was not possible. Following use cases demonstrate when it can be useful to exchange constants and/or resources without rebuilding the binary:

Customer needs to replace logos and texts (e.g. copyright notice) in a device created by an OEM

ROM (flash) is not large enough to store all language variants needed in the device. In such case, the set of languages is divided in language packs each containing one or few relevant languages. Before the device is used in a region, the region specific language pack is installed on it.

Entire set of bitmap resources and color constants need to be replaced to support themes without maintaining all theme variants in the binary and occupy up ROM flash memory unnecessarily.

To avoid laborious test repetitions after localization of an application, the binary is not allowed to be changed. The localized texts and bitmaps may not belong to the binary.

In order to meet these or similar requirements, the storage of constants and resources has been redesigned and enhanced by so-called Blob files. From technical point of view, a Blob file stores the binary representation of the affected constants and resources as if they were compiled and linked by a C compiler. Embedded Wizard created application can thus process the content of a Blob file similarly as it does with data which is fixed compiled inside the application.

The data, thus, is not part of the binary. The code generated for the application limits to refer the data members existing in the Blob file only. At the runtime when accessing a constant or resource from the Blob file, the Blob file is searched for the referenced member and the found member is used. By exchanging the Blob file, the contents of constants and resources can be modified easily. The application itself (the binary) can remain untouched in such case.

For more details see the chapter Blob files and Storage attribute.

Improvement of localization functionality

In order to simplify the localization tasks of a GUI application for different languages, Embedded Wizard 14 has been enhanced by following new features and modifications:

Localization of Font resources

Before version 14, glyphs specified in different language variants of a Font resources were not allowed to overlap. A character code was restricted to uniquely address exact one glyph. Starting with version 14, overlapping of glyphs is allowed. Now, the user can configure a Font resource with different glyphs, e.g. for Chinese, Japanese or Korean languages even if the glyphs are associated to the same character code. The selection of the right glyph depends in such case on the actually active language.

For more details see the section Localize a font resource.

New Chora method format()

Chora data type string has been enhanced by new instant method format(). This method searches in a given string for placeholders and replaces them by corresponding string operands provided in parameters of the method. As such the method is useful to format messages which involve other text fragments, like "Do you want to delete the file {1}?". The expression {1} acts as a placeholder, which at the runtime of the application can be replaced by the right content, for example by the file name.

The advantage of this enhancement is that persons responsible for the translation don't need to worry about the original composition and the order of text fragments within the translated message. This is true even if the syntax of the particular languages imposes the operands to be formatted in different order.

Overflow warning

The Text view has been enhanced by a new property OverflowWarning. By using this property you instruct the view to report warnings if the displayed content is too large (e.g. the text is too long) which results in the text being clipped. The warning appears at the runtime on the console in the target system or during prototyping in the Log window. During prototyping additional information is provided helping you to better detect which string in which view is raising the warning.

This new feature is explicitly intended to be used during tests of the application. In particular, it is useful when the application should be localized for different languages and the persons responsible for the translation have no possibility to verify whether the translated texts have not exceeded the available size. By evaluating the warnings collected during a test you can decide either to enlarge the respective view or to the modify the string to appears shorter.

Automatic font size adjustment in Text views

If your application case requires the text to be scaled in order to fill the Text view area as good as possible, you have to manage in your project multiple copies of the Font resource, each copy with a different size. A short text can then be displayed with large font while to display long text, a smaller version of the font is used. Before version 14, the necessary font selection had to be made manually. In version 14, you can use the new class Resources::FontSet for this purpose.

The FontSet, as its name reveals, is intended to group multiple Font resources together. The Font resources can have different sizes and different styles or appearances. At the runtime, Text views connected to a FontSet select from the available fonts the font version, which is best appropriate to display their content. When the associated string or the size of the Text view changes at the runtime, the font selection is repeated automatically.

This approach is convenient especially for use cases of a localized application where strings in different language variants occupy different amount of space. In the classical approach, you have to ensure that all Text views are large enough to display the respective strings in all languages without clipping the strings. For this purpose, you have to test all GUI components existing in the application in all possible language variants. By using a FontSet, the text view will automatically select a smaller font if the string is too long. Provided you have configured the FontSet correctly, the time intensive test of the GUI in all language variants can be reduced or even completely avoided.

For more details see Adjust text size to best fill the Text view (scale text).

New general purpose Export/Import infrastructure

With version 14 new general purpose export and/or import functionality has been added. The new functionality is available through a new menu item PROJECTExport and|or import tool .... Activating the menu item opens the following Start export and/or import tool ... dialog. In this dialog the desired operation can be configured:

New dialog to configure the export/import operation

The actual export/import operation is carried out by an external tool, which can be a Windows executable, command line tool or just a script written in your preferred language. In any case, when using this feature Embedded Wizard starts the external tool and provides it with all project contents intended for the export. The project contents are encoded as text in Chora syntax. The tool can thereupon process this text and depending on the purpose of the tool, extract interesting project parts, transcode them in other formats, etc.

In the similar manner, the tool can provide Embedded Wizard with project contents intended for the import. Again, the contents are encoded as text in Chora syntax. Embedded Wizard can evaluate the contents and integrate them into the project structure. Depending on the configuration of the import operation, new imported contents can replace existing contents or can be just appended to the project. This allows incremental imports and re-imports (updates of already made imports).

In addition to the export and import operations, the new functionality is also suitable for evaluating project contents with external tools, for example to extract statistical information from the project or to carry out sophisticated search/evaluation processes on the project that go beyond the search functions integrated in Embedded Wizard. In such case it is convenient that the external tool has the possibility to provide Embedded Wizard with information, warning and error messages which thereupon are listed in the Log window.

Other target specific improvements

A small workaround added to improve alpha blending on targets with limited color space (e.g. RGB565). The modifications rounds the color channels after performing pre-multiplication. This workaround should reduce the flicker effects during fade-in/out operations of solid filled areas.

Runtime Environment has been enhanced by new functions EwInitRuntimeEnvironment() and EwDoneRuntimeEnvironment(). The usage of the functions is optional and needed only in the case when the Runtime Environment has to be restarted.

Other Mosaic improvements

Eliminate unnecessary dependencies to DefaultBitmap and DefaultFont from Graphics::AttrSet class. This reduces the amount of generated code.

Other Embedded Wizard Studio improvements

Modification of Drag&Drop in Code Editor to starts only when the user holds CTRL, ALT or SHIFT keys pressed.

The Search in Project dialog has been enhanced by an additional option to ignore block/line comments existing inside Chora code (e.g. inside a method).

Bug Fixes

Scope Assistent was not displayed when the respective expression was found after the return statement. For example, entering the code return (new Core::Time). did not display the Assistant window after the . (dot) sign has been entered.

Page fault on WINE with CHORAC.EXE being invoked without project name.

Incorrect handling of ClipViews property in Vertical und Horizontal Lists. Since the List components are highly optimized to reuse the displayed items, disabling the clipping for a List produced unexpected results. For example, the list appeared incomplete. The property ClipViews in classes HorizontalList and VerticalList has been changed to be read-only. Trying to disable the clipping will report an error. The method ExtendClipping() in classes HorizontalList and VerticalList is not available anymore. Invoking the method reports an error.

Disabling a potential division by zero warning reported by static analysis.

Disabling diverse C warnings.

Different behavior of notifyobservers on WebGL. On WebGL trying to post the same signal for the fourth time throws an exception. Other targets limit to report an error message. WebGL has been adapted to behave similarly.

Different behavior of Touch Handlers depending on Embedded Wizard version. Starting with version 12 short taps were sometimes not propagated to the underlying touch handlers.

Erroneous code generation in do...while(false) construction.

Missing Code Editor color setting for rect literals.

Missing single precision specification in floating point literals inside the ewscalars.c module. This resulted in unnecessarily double precision calculations.

The restriction for not available Bitmap resource DirectAccess mode was ignored. As consequence, bitmaps were generated in DirectAccess mode even if this mode is configured as not available in the particular target system. Now the Compressed mode is imposed and dedicated warning is reported.

In generated code, integer literals of uint64 or int64 type were missing the type suffix LL or ULL in some cases. As consequence, expressions involving such literals were compiled as 32-bit types.

Incorrect optimization of homonymous properties implemented in different classes. During elimination of an onset method containing pure Foo = value wrong scope for Foo was assumed. This caused a method containing pure A.Foo = value to be eliminated unexpectedly.

Nested switch-case using fallthrough reported an error message unexpectedly.

The distribution of values returned by math_rand() was incorrect resulting in the value specified in parameter aValue2 being returned unproportionally seldom.

Type conversion between float and uint32 types produced a type cast to signed int in the generated code.

Crash during prototyping when Prototyper exits.