Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does java use an oblique font when asking for a plain monospaced font?
    primarykey
    data
    text
    <p>I create a monospaced font in my application with :</p> <pre><code>Font f = new Font(Font.MONOSPACED, Font.PLAIN, 18); </code></pre> <p>When I run the application on a PC, the font looks fine (<code>Ubuntu 12.04 LTS, Java SE Runtime Environment - build 1.7.0_25-b15</code>).</p> <p>When I run the application on an ARM computer, the font is slanted to the right (<code>Debian Squeeze, armel, Java SE Embedded Runtime Environment - build 1.7.0_10-b18</code>).</p> <p>I tested this small program :</p> <pre><code>public class Main { public static void main(String[] args) { setTerminalFont(new Font(Font.MONOSPACED, Font.PLAIN, 18)); setTerminalFont(new Font("DejaVu Sans Mono", Font.PLAIN, 18)); } private static void setTerminalFont(Font x_font) { System.out.println("Font family=["+x_font.getFamily()+"] name=["+x_font.getFontName()+"] i-angle="+x_font.getItalicAngle()); } } </code></pre> <p>On the PC computer, it prints:</p> <pre><code>Font family=[Monospaced] name=[Monospaced.plain] i-angle=0.0 Font family=[DejaVu Sans Mono] name=[DejaVu Sans Mono] i-angle=0.0 </code></pre> <p>On the ARM computer, it prints:</p> <pre><code>Font family=[Monospaced] name=[Monospaced.plain] i-angle=0.1899996 Font family=[DejaVu Sans Mono] name=[DejaVu Sans Mono Oblique] i-angle=0.1899996 </code></pre> <p>Can someone explain why the ARM version uses <em>DejaVu Sans Mono <strong>Oblique</strong></em> ?</p> <p>How can I make java to use the plain <em>DejaVu Sans Mono</em> font instead of an oblique one ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload