Release notes: Embedded Wizard 9.10

Version 9.10 contains the following changes and improvements:

Support of Bidirectional Text

Embedded Wizard supports now bidirectional text (BIDI) output with left-to-right (LTR) and right-to-left (RTL) text writing order, as well as combinations of them. This makes it possible to show Arabic or Hebrew strings (RTL order) combined with Latin strings (LTR order). The bidirectional text output is implemented according to the Unicode Standard Annex #9 Unicode version 10.0.0.

For printing Arabic strings, contextual shaping and mandatory ligatures are supported.

In order to support bidirectional text, the following enhancements and modifications have been implemented:

The declaration of the Graphics Engine function EwParseFlowString() has changed to expect the parameter aWidth and aMaxNoOfRows. If the parameters are negative, no width or row limitation is taken into account. The function EwParseFlowString() is reimplemented to be prepared for BIDI integration. The output format of the flow-string has been changed to be more compact. Now, invisible signs are also taken over into the flow-string so the number of signs in the flow-string is the same as in the original raw string plus the control signs for every row.

The BIDI functionality can be removed if the macro EW_DONT_USE_BIDI_FUNCTIONS is defined. In case you do not need this feature, you can reduce the code size.

The methods RowCol2Position() and Position2RowCol() of the class Views::Text have been rewritten to handle bidirectional text when dealing with the glyph calculation.

The Text view has been adapted to handle the alignment mode AlignHorzJustified separately from the other alignment modes AlignHorzLeft, AlignHorzRight and AlignHorzCenter. Now, AlignHorzJustified can be combined with AlignHorzLeft, AlignHorzRight or AlignHorzCenter. The additional horizontal alignment mode AlignHorzAuto is used to automatically align the text depending on the displayed content.

All widgets that contains text items (Push Button, Radio Button, Toggle Button and Value Display) have been adapted to enable the BIDI text processing. Accordingly, the widgets will display Arabic or Hebrew text as expected. The horizontal alignment can be controlled in the associated configuration object.

The text wrap algorithm has been modified to not eliminate the sequence of space signs at wrap position. Now, only the space sign causing the wrap is eliminated. Other space signs following it are taken over to the next row. This makes the behavior of Text view more predictable and it is important for better working Text Editor components.

The handling of Ellipsis in Text view has been reworked and prepared for BIDI.

The method StringIndex2RowCol() of Views::Text has been adapted to return <0,0> if Ellipsis mode is active. The calculation with indices is not possible if text have been removed and replaced by an ellipsis sign.

The method RowCol2StringIndex() of Views::Text has been adapted to return 0 if Ellipsis mode is active. The calculation with indices is not possible if text have been removed and replaced by an ellipsis sign.

In order to display the BIDI text please set the property EnableBidiText.

The Attributed Text view is also supporting bidirectional text. The paragraph alignments {par.. are enhanced to allow l, r, c being combined with j for justified mode. The additional paragraph attribute {para (with a) can be used to automatically align the text depending on the displayed content.

The Text view is enhanced by the methods IsBidiText(), IsBaseDirectionRTL(), IsCharDirectionRTL() permitting to evaluate whether the text or an individual character at the specified position has RTL or LTR writing direction.

The Text Editor component template has been adapted to work with the new version of the Text View. The Text Editor component can work with right, center and even justified alignment.

IMPORTANT

The methods StringIndex2RowCol() and RowCol2StringIndex() in the class Views::Text have been reimplemented to handle correctly the special cases resulting from UNICODE zero-width signs and the diverse BIDI control signs and other special cases. They also have been corrected to not count the zero-terminator following the new-line sign as column. This modification will affect existing projects using the Text Editor component template. The caret navigation in an existing Text Editor may work incorrectly with the new version of Mosaic.

In case your project contains a Text Editor component, please make the following adaptations:

Adapt the method onCursorKey() within your Text Editor component. Search for the following code

  // Skip to the begin of the next row?
  if ( rc.x == Text.GetRowString( rc.y ).length )
  {
    rc.y = rc.y + 1;
    rc.x = 0;
  }

and replace it with

  // Skip to the begin of the next row?
  if ( rc.x == Text.GetRowString( rc.y ).length + 1 )
  {
    rc.y = rc.y + 1;
    rc.x = 0;
  }

Adapt the method onPressTouch() within your Text Editor component. Search for the following code

var point rc            = Text.Position2RowCol( SimpleTouchHandler.CurrentPos );
var int32 newCaretIndex = Text.RowCol2StringIndex( rc );

and replace it with

var point rc            = Text.Position2RowCol( SimpleTouchHandler.CurrentPos );
var int32 newCaretIndex = Text.RowCol2StringIndex( rc );
var string rowStr       = Text.GetRowString( rc.y );

if (( rc.x == rowStr.length ) && ( rowStr[ rc.x - 1 ] == '\x00A0' ))
  newCaretIndex = newCaretIndex  - 1;

Adapt the method onDragTouch() within your Text Editor component. Search for the following code

var point rc            = Text.Position2RowCol( SimpleTouchHandler.CurrentPos );
var int32 newCaretIndex = Text.RowCol2StringIndex( rc );

and replace it with

var point rc            = Text.Position2RowCol( SimpleTouchHandler.CurrentPos );
var int32 newCaretIndex = Text.RowCol2StringIndex( rc );
var string rowStr       = Text.GetRowString( rc.y );

if (( rc.x == rowStr.length ) && ( rowStr[ rc.x - 1 ] == '\x00A0' ))
  newCaretIndex = newCaretIndex  - 1;

Image and Text Orientation

The Image view and the Group view are enhanced by the new property Orientation. This property can assume the values Normal, Rotated_90, Rotated_180 or Rotated_270. It allows the user to simply change the orientation of an image or change the orientation of a projected component content. The orientation affects the alignment. For example, if the Image view is configured to rotate the bitmap 90 degrees and the bitmap is aligned to the left edge, the view will arrange the bitmap at its bottom edge.

The Text view is also enhanced by the property Orientation permitting the user to rotate the displayed text. The view has been reworked to calculate with rotated coordinates. Please note, rotating the text affects the alignment constraints. For example, 90 degrees rotated text rows are horizontally aligned to the bottom edge of the text view.

The Graphics Engine function EwDrawText() has been enhanced by a new parameter aOrientation. Actually this parameter may assume values 0, 90, 180, 270 controlling the text orientation. Customers using this function directly from C or JavaScript code have to add 0 value at the corresponding argument position.

The method DrawText() in class Graphics::Canvas has been enhanced by the parameter aOrientation. Customers using this method from Chora code have to add Views::Orientation.Normal at the corresponding argument position.

Support of Kerning

Embedded Wizard supports now kerning of fonts for all TrueType fonts that contains the kerning information. Kerning is used to adjust the spacing between individual glyphs in order to improve the appearance and readability.

The font converters of Embedded Wizard Studio are enhanced to generate data containing the kerning information. The Graphics Engine is enhanced to evaluate the kerning information during runtime and to consider this information in all text drawing operations.

The Mosaic class Resources::Font has been enhanced by the new methods IsGlyphAvailable() and GetKerning().

The Graphics Engine interface to external font engine is enhanced by new functions EwTtfIsGlyphAvailable() and EwTtfGetKerning(). Both functions have to be implemented in case of customer's own TrueType font engine integration. The default integration with FreeType engine adapted to support EwTtfIsGlyphAvailable() and EwTtfGetKerning().

Embedded Wizard Studio Improvements

The Search in project function has been reworked. Now a 'Searching ...' dialog appears during the search operation permitting the user to abort the operation.

The Code editor assistant is enhanced to list the new attributes of Attributed Text as resulting from the BIDI adaptation.

The Code Editor assistant is enhanced to react on % (percent) sign entered within a string literal. The Assistant shows the options to add %%, %^, %~ and %{.

The Variables window is improved to automatically adjust the width of the 'Name' column depending on the nested and expanded values.

Examples

The example StringTable contains now Arabic and Hebrew text items.

Bug-fixes

Embedded Wizard Studio: Bug-fix for an access violation. In case that the class Core::Group is opend within the Composer window and the class is reloaded by pressing F7 a crash happened.

Mosaic: Bug-fix in Text view if Padding and AutoSize were used in combination. In such case the resulting area of the view was incorrect.

Mosaic: Bug-fix in Text view if Padding and Ellipsis were used in combination. In such case the Padding was ignored when calculating the width of the text.

Mosaic: The widgets Gauge and Rotary Knob are adapted to show the tracks correctly if their end caps are overlapping.

Mosaic: Bug-fix for accumulated rounding error in Charts::LineChart.Draw() which caused cut graphs on the right side when graph is scrolled.

Mosaic: Bug-fix incorrectly working vector graphic views Filled Path and Stroked Path if the ScreenOrientation is not Normal and the view is configured with its property Buffered being set true.

Mosaic: Bug-fix for the method Resources::Font.GetTextExtent(). The method calculated incorrectly the last glyph. It was clipped sometimes.

Mosaic: The stretching of justified text worked incorrectly causing the resulting text to be slightly wider.

Mosaic: The area calculated by Views::Text.GetRowArea() is now correct. In previous version the area seemed sometimes to be clipped.

Embedded Wizard Studio: Bug-fix in New Project Dialog - it was limiting the length of the text entered in the Location edit field.

Resource Converter: The empty columns separating frames in a multi-frame bitmap were not properly zeroed in case that the FormatOfBitmapResources was set to DirectAccess. As a result, the separating colums contained random values in the generated code. The problem is fixed.

Resource Converter: Bug-fix for crash of Embedded Wizard Studio, caused by converting large bitmaps which consist of many frames with more than 37000 pixel width totally.

Embedded Wizard Studio: Bug-fix for native statement using operands separated by . instead of a ,. The bug caused Embedded Wizard Studio to crash.

Graphics Engine and Runtime Environment: Adaptation of the memory usage calculation to take in account also peak values.

WebGL: Bug-fix in WebGL obfuscation of Inline Code Members.

WebGL: Bug-fix for type conversions from enum to integer and type conversions from set to integer in case that the expression (the operand) in the cast operand was already constant.

WebGL: Minor adaption of WebGL Platform Package to allow the user to call the _RequestUpdate() function. Usually all updates are scheduled automatically during the runtime of the application. However, if the user implements extern code to e.g. receive data via WebSocket and then invokes a Chora method from the 'outside' of the GUI application, no update is performed after the method is finished. Therefore, the user has to execute following code in order to trigger the update: EmWiApp._RequestUpdate();