Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/Tools/GraphBrowser/graphbrowser/   (Isabelle Prover Version 2025-1©)  Datei vom 16.11.2025 mit Größe 1 kB image not shown  

Quelle  DefaultFontMetrics.java

  Sprache: JAVA
 

/***************************************************************************
  Title:      graphbrowser/DefaultFontMetrics.java
  Author:     Stefan Berghofer, TU Muenchen
  Options:    :tabSize=2:

  Default font metrics which is used when no graphics context
  is available (batch mode).
***************************************************************************/


package isabelle.graphbrowser;

public class DefaultFontMetrics implements AbstractFontMetrics {

  private static int[] chars =
 {1313172727433211161619281328131327,
  2727272727272727271313282828274932,
  3235353229373513243227403537323735,
  3229353245323229131313222711272724,
  2727132727111124114027272727162413,
  27243524242416121628};

  private int size;

  public DefaultFontMetrics(int size)
  { this.size = size; }

  public int getLeading()
  { return 1; }

  public int getAscent()
  { return (int)(Math.round(size * 46.0 / 48.0)); }
  
  public int getDescent() 
  { return (int)(Math.round(size * 10.0 / 48.0)); }
  
  public int charWidth(char c) {
    if (c < 32 || c > 126) { return 0; }
    else {
     return (int)(Math.round(chars[c - 32] * size / 48.0));
    }
  }
  
  public int stringWidth(String s) {
    int l=0, i;
    for (i=0; i < s.length(); i++) { l += charWidth(s.charAt(i)); }
    return l;
  }
}

Messung V0.5 in Prozent
C=98 H=95 G=96

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-29) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.