Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8123717

Glitches in system font anti-aliasing (Linux platform)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 8
    • 8
    • javafx

      The glitches: http://img585.imageshack.us/img585/4344/7sk4.png
      Without glitches: http://img43.imageshack.us/img43/1892/kue1.png

      Here's the minimal code I could come up with, demonstrating the issue (comment/uncomment the "-fx-font-family: Roboto;" to make the issue appear/go away).

      (It's written with the scalaFx dsl convenience, but this shouldn't matter here.)

      {code}
      package glitchtest2

      import scala.collection.JavaConverters._
      import scalafx.Includes._
      import scalafx.application.JFXApp
      import scalafx.scene.Scene
      import scalafx.stage.Stage
      import scalafx.scene.control.{Button, Label}
      import scalafx.scene.layout.VBox
      import scalafx.scene.text.Text

      object GlitchTest2 extends JFXApp {

        stage = new JFXApp.PrimaryStage {
        
          width = 600
          height = 450
          
          scene = new Scene {
          
          stylesheets = Set("http://fonts.googleapis.com/css?family=Roboto")
          
            content = Set(new VBox {
                
                content = Set(
                
                  new Button("Search") {
                    style = "/*-fx-font-family: Roboto;*/ -fx-font-size: 11px;" // <= Uncomment to make the issue go away
                  },
                  
                  new Text("Search") {
                    style = "/*-fx-font-family: Roboto;*/ -fx-font-size: 11px;" // <= Uncomment to make the issue go away
                  },
                  
                  new Label("Search") {
                    style = "/*-fx-font-family: Roboto;*/ -fx-font-size: 11px;" // <= Uncomment to make the issue go away
                  }
                )
              }
            )
          }
        }
      }
      {code}

      https://docs.google.com/file/d/0B7lrDAvzeFVyZ09NeWdKMjh0aGM/edit?usp=sharing
      => The code archive containing this file + the gradle build dependencies (scala + scalafx) to launch it.

      (Btw, is it on purpose that with modena.css, Text uses grayscale antialiasing while Label and Button use the colorscale (cleartype or smthg)?)

      --
      Edit: changing the system fonts (kde) doesn't seem to have an impact on the JavaFx default font used (so good chances are the bad anti-aliasing comes from this fallback/default javafx font).

            msoch Martin Ĺ och
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: