HTML5 Canvas fillText with Right-to-Left string

前端 未结 4 1107
抹茶落季
抹茶落季 2021-01-05 01:48

I am trying to use the fillText() method on an HTML5 Canvas\' 2d Context to draw a string written in Arabic. It works perfectly, until I put a punctuation mark at the end of

4条回答
  •  悲&欢浪女
    2021-01-05 02:20

    You don't need to set the direction for each individual string. See the following example which also shows the proper use of implicit bidi control marks for proper display order:

    
    
      
    
    
      
        
          Your browser does not support the HTML5 canvas tag.
        
    
        
    
      
    
    

    And here is the output: as rendered by Chrome <code>26.0.1410.64 m</code> on MS Windows XP SP3

提交回复
热议问题