title: Displaying complex indic Bangla font in JavaFX
body: <p>In my program I am reading a Bangla (Indic Language) text from a UTF-8 file and displaying in Text component of JavaFx. Though the characters are being displayed , they are not positioned properly.</p>
  
  <p>In this type of complex script language some of the vowels should wrap around the letter both in the left and right side but in some of the computers it is showing in a wrong manner i.e. first the vowel and then the letter.</p>
  
  <p>e.g. the words which contains the "split vowel" ো are not displayed correctly.
  <a href="https://bug686225.bugzilla.mozilla.org/attachment.cgi?id=559780" rel="nofollow noreferrer">https://bug686225.bugzilla.mozilla.org/attachment.cgi?id=559780</a></p>
  
  <p>In the system it got fixed using <a href="http://www.tariquemahmud.net/?p=35" rel="nofollow noreferrer">http://www.tariquemahmud.net/?p=35</a> but in the JavaFx Program  , the problem still continues.</p>
  
  <p>Wrong display
  <img src="https://i.stack.imgur.com/PN4J8.jpg" alt="Wrong display"></p>
  
  <p>Correct Deisplay
  <img src="https://i.stack.imgur.com/sFLnB.png" alt="Correct Deisplay"></p>
  
  <p>You can check yourself if the following executable looks correct or wrong as per above screenshot in your computer </p>
  
  <p><a href="http://dl.dropbox.com/u/655237/share/BanglaTest.zip" rel="nofollow noreferrer">http://dl.dropbox.com/u/655237/share/BanglaTest.zip</a></p>
  
  <p>I am using the following code</p>
  
  <pre><code>package banglatest;
  
  import java.io.File;
  import java.io.FileNotFoundException;
  import java.net.MalformedURLException;
  import java.util.Scanner;
  import javafx.application.Application;
  import javafx.scene.Scene;
  import javafx.scene.layout.StackPane;
  import javafx.scene.text.Font;
  import javafx.scene.text.Text;
  import javafx.stage.Stage;
  
  public class BanglaTest extends Application {
  
      @Override
      public void start(Stage primaryStage) throws MalformedURLException {
          Text text = new Text();
          File file = new File("data.txt");
          StringBuffer sb = new StringBuffer();
          try {
              Scanner scanner = new Scanner(file,"UTF-8");
              while (scanner.hasNextLine()) {
                  String line = scanner.nextLine();
                  sb = sb.append(line);
              }
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          }
          text.setText(sb.toString());
          Font font = Font.loadFont(new File("bangla.ttf").toURL().toExternalForm(), 20);
          text.setFont(font);
          StackPane root = new StackPane();
          root.getChildren().add(text);
          Scene scene = new Scene(root, 300, 250);
          primaryStage.setTitle("Hello World!");
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>