Jump to content

Alexander Sviridenkov

Members
  • Content Count

    259
  • Joined

  • Last visited

  • Days Won

    26

Posts posted by Alexander Sviridenkov


  1. @limelect try to display the following text in Android

     

    Student: How do you write "What's your name?" in Arabic?

    Teacher: ما اسمك؟

    Student: Thanks.

    Teacher: That's written "شكرًا".

    Teacher: Do you know how to write "Please"?

    Student: "من فضلك", right?


  2. OK, several samples. FMX form with HtPanel on left and standard memo on right.

    Windows, standard FMX canvas:

    2136995520_2019-11-0414_50_39.thumb.png.9a4d6705de141f7fbc395f7f0051281a.png

     

    Here kerning pairs are correct on both sides and arabic letters are connected as it should and have correct order because FMX canvas use windows Direct2D layout for rendering. But word order in sentense with mixed english/arabic text is incorrect on right side and correct on left, because in HtPanel text is prepared by internal BiDi processor.

     

    Android, standard FMX canvas:

    Screenshot_20191104_150411_com.embarcadero.AndroidScroll.thumb.jpg.c58f2f07690d128b682c1498c66bab0e.jpg

     

    On mobile platforms FMX output each letter as single bitmap. So kerning pairs are not processed and arabic letters are not connected. Word and letter order is correct on left side because of internal BiDi processor, but still no kerning and letter connectors.

     

    Android, native Android canvas:

    Screenshot_20191104_150544_com.embarcadero.AndroidScroll.thumb.jpg.6bfbdaf28487eb88dce6e7aa51da9ecd.jpg

     

    Kerning and letter connectors are correct.

     

    There is also another issue with FMX canvas ion mobiles. Here is the same form with scaling set to 10x for both components.

    Screenshot_20191104_151119_com.embarcadero.AndroidScroll.thumb.jpg.7934c76a1ac1825ade4461a56ae762c2.jpg

     

    FMX use bitmap scaling instead of preparing bitmaps for each font size. This leads to visual artefacts and blurred text.

     

     

     

    • Sad 1

  3. 41 minutes ago, John Kouraklis said:

    @Alexander Sviridenkov So, you don't use bitmaps on those platforms? but the native engines?

     

    Do your components support then RTL?

    Depends on selected canvas,  For iOS, Android and OSX there are both native and FMX canvases.

    RTL is supported internally, library has own BIDI processor because even on native canvases each word is rendered separately, so layout should be prepared before passing to renderer.


  4. FMX use different methods for text rendering on mobile and desktop platforms. On desktop platforms native OS methods are used (f.e. Direct2D text layout or CGContext) but on mobile platforms text is rendered as bitmap combination - each font symbol is stored in cache as bitmap.

    This leads to no RTL support, bad kerning, etc and also is slow., This is why I had to write native canvas support for these platforms.

    • Thanks 1
    • Sad 1

  5. What's new

     

    New editor features video:

    https://www.youtube.com/watch?v=3bzLyFwmdM4

     

    HCL/Core

     

    Much faster drawing, style calculation and text selection, especially for very large documents

    New THtDocument.FormattedHTML method.

    Improved CSS animations support.

    Improved lines/borders rendering on HDPI screens and scaled documents.

    Improved text rendering on GDI+ canvas.

    Added SourceURL to HTML clipboard header

    Added THtDocument.SavetoStreamANSIEncoded.

    Workaround for Windows/OSX bug with double quote symbol in Times/italic fonts.

    Infinite support for CSS animations

    All image lists now changed to TCustomImageList to support VirtualImageList.

    New THtDocument.ConvertAttributestoStyle method for converting HTML attributes into inline CSS style.

    Added CSS text-decoration-style property

    Added CSS cursor: help

    Added SVG stroke-linejoin and stroke-linecap support.

    Incorrect font size values are now ignored

    Added column width parameter to InsertCol

    Improved quirks/normal mode support

     

    Editor

     

    Much faster text selection, caret positioning and text input

    New customizable selection toolbar (popup) for both VCL and FMX

    Improved RTF import

    Improved print preview window scrolling and zoom

    Added Active=false mode for fast editing of very large documents (1000+ pages)

    Better support for pasting HTML from clipboard in non-unicode Delphi

    Added RTF pasting from clipboard when HTML is not available.

    Added OnPrepareImage param to DocXtoHTML and RTFStringtoHTML

    Added support for WMF-JPEG conversion on RTF/DOCX import for Delphi 7-2009

    New OnURLDetected event - fired when URL is detected in document.

    New eoEnterSoftBreak option for swapping Enter and Shift+Enter behavior.

    Improved Outlook compatibility.

    New eoHighlightCurrentBlock and eoShowSelectionToolbar options.

     

    Reports

     

    Added startangle parameter for pie charts

    Added direction="cw/ccw" parameter for pie charts

    Reports: added x-order attribute for arranging x-values in stacked charts.

     

    Email

     

    Email library now available for all platforms.

    Added SelectFolder method for selecting IMAP folders.

     

    Scripter

    Added FreeandNil procedure

    Calling Free() for object variable will clear variable.

    Script: added record helpers from IOUtils unit: TDirectory, TFile, TPath.

     

    SQL

     

    SELECT INTO support.

    New TSQLInsertQuery, TSQLUpdateQuery classes.

    DECODE column now returns correct data type based on values.

    WITH .. AS support for Oracle dialect.

    Support for PIVOT operator

    Added HasFetchLimit and FetchLimit functions.

    Support for ElevateDB SQL dialect

    New ConvertWheretoJoins method

     

    https://delphihtmlcomponents.com

     

    • Like 5

  6. Code for each item is relatively simple. For example list type selector consists of two classes, first for drop down panel:

    THtEditContextList = class(THtEditContextItem)
    public
      function Render: string; override;
    end;
      
    function THtEditContextList.Render: string;
    
    procedure Add(const ListType, ListTag: string);
    begin
      Result := Result + Format('<div class="eclistbox fade" listtype="%s"><%s style="list-style-type: %s"><li>———</li><li>———</li><li>———</li></ol></div>',
        [ListType, ListTag, ListType]);
    end;
    
    begin
      Result := '';
      Add('none', 'ul');
      Add('circle', 'ul');
      Add('disc', 'ul');
      Add('square', 'ul');
      Add('decimal', 'ol');
      Add('lower-alpha', 'ol');
      Add('lower-roman', 'ol');
      Add('upper-alpha', 'ol');
      Add('upper-roman', 'ol');
    end;

    And second for the button:

    THtEditContextListStyle = class(THtEditContextLiveItem)
    public
      function Render: string; override;
      procedure OnSubmenuElementEnter(Sender: TElement); override;
      procedure OnSubmenuClick(const Sender: TElement; Button: TMouseButton; Shift: TShiftState); override;
    end;
    
    procedure THtEditContextListStyle.OnSubmenuClick(const Sender: TElement;
      Button: TMouseButton; Shift: TShiftState);
    begin
      OnSubmenuElementEnter(Sender);
    end;
    
    procedure THtEditContextListStyle.OnSubmenuElementEnter(Sender: TElement);
    begin
      if Sender['listtype'] <> '' then
      begin
        if Sender.NodebyName('ol') <> nil then
          Editor.SetListStyle('ol', Sender['listtype'])
        else
          Editor.SetListStyle('ul', Sender['listtype']);
        Editor.Repaint;
      end;
    end;
    
    function THtEditContextListStyle.Render: string;
    begin
      id := 'list';
      Result := '<div id="list" class="ecbutton down fade"><div class="faicon">&#61643;</div>&nbsp;</div>';
      FSubmenuClass := THtEditContextList;
      FDefaultSubmenuWidth := 300;
    end;
    

     

    Code for building menu:

     

        ContextPanel.Add(THtEditContexBold).Add(THtEditContextItalic).Add(THtEditContextUnderline).
          Add(THtEditContexStrike).Add(THtEditContexSpace).Add(THtEditContextTextColor).Add(THtEditContextBGColor).
          Add(THtEditContextFontSize).Add(THtEditContextFont).
          Add(THtEditContexLineBreak).Add(THtEditContexAlignLeft).Add(THtEditContexAlignCenter).Add(THtEditContexAlignRight).Add(THtEditContexAlignFull)...

     

    editorcontext.gif

    • Like 1

  7. On 8/26/2019 at 9:53 AM, TigerLilly said:

    We used it, because we had the need, that our users were able to edit the report after generation.

     

    HTML Report Library produce plain HTML which can be edited using WYSWYG HTML Editor.

    Unlike some other report engines, elements are in normal flow (absolute positioning can be used but is not required), so editing will not break document layout.

    • Like 2

  8. Yes, this is part of HTML Library bundle. Code editor combines Scripter and SQL framework to make code completion works for both pascal and SQL code in one window.

    Also this demo shows ability to add design time method checking for classes in scripter (in this case checker is added to TXQuery class and checks that parameters in SQL query corresponds to parameter array).

    • Like 1
×