Emacs: choosing normal monospace font in Emacs but gives bold-italic

Bug #791076 reported by Triwanto Simanjuntak on 2011-06-01
106
This bug affects 20 people
Affects Status Importance Assigned to Milestone
GNU Emacs
Undecided
auto-8798
Ubuntu Font Family
Low
Unassigned
emacs23 (Ubuntu)
Undecided
Unassigned

Bug Description

Problem: Graphical Emacs uses Bold-Italic when "UbuntuBeta Mono" is selected.

Workaround for the moment:

  sudo rm /usr/share/fonts/truetype/ubuntu-font-family/UbuntuBetaMono-BI.ttf

I just installed the beta Ubuntu Mono space font and when i tried in Emacs by: "Options--> Set Default Font -->UbuntuBeta Mono, regular", the bolded italic was displayed instead (see the attachment). Any clue why this happened and how to fix it?

Forwarded upstream:

  "23.2: graphical Emacs chooses Bold-Italic when regular monospace font chosen"
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8798

Triwanto Simanjuntak (lu176) wrote :
description: updated
Xavier Garrido (xavier-garrido) wrote :

Same for me

Dimitri John Ledkov (xnox) wrote :

No idea if this is a bug in the font or emacs, but it sure is annoying. By default emacs doesn't use "synthesized" bold and italics variants for monospaced fonts. I have no other monospaced font available which has native same-width bold,italics,bold+italics variants. Cause it is possible that somewhere in the defaults emacs prefers native bold+italics?

Paul Sladen (sladen) on 2011-06-04
summary: - choosing normal font in Emacs but gives bolded italic
+ Emacs: choosing normal monospace font in Emacs but gives bolded italic

Forwarded upstream:

  "23.2: graphical Emacs chooses Bold-Italic when regular monospace font chosen"
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8798

Changed in ubuntu-font-family:
status: New → Incomplete
Changed in emacs23 (Ubuntu):
status: New → Triaged
tags: added: uff-emacs uff-metadata uff-stack uff-upstream
tags: added: uff-monospace
Changed in ubuntu-font-family:
importance: Undecided → Low
description: updated
Lukas Persson (lukas-persson) wrote :

Same problem for me, I once tried to install the font Inconsolata and I got the exactly the same problem that time around, bold italic was what I saw totally ignoring what I chose in the settings. Both times the monospaced font looked perfect in terminal. This makes me believe that emacs is the culprit here.

Paul Sladen (sladen) wrote :

Lukas: good to know. Could you follow up to <email address hidden> with the information about Inconsolata too.

I did my own investigation of the font files using version 0.4 of the
monospace. The Regular, Italic, and Bold are all 100% to-spec monospace
fonts. There is a small metrics bug in the Bold Italic which means it's
not quite a to-spec monospace font.

The odd thing is the applications which are picking the Bold Italic up
as the only weight, when in fact it's the only weight which isn't quite
right. So yes, we need to fix the Bold Italic, but it looks like we've
tickled some odd app bugs too.

Dave

Per Jamesf in the dup, this can also be replicated with:

  echo Emacs.font: UbuntuBeta Mono-11 >> ~/.Xresources && xrdb -merge ~/.Xresources && emacs

Paul Sladen (sladen) wrote :

Hmmm, also reproducible simply with:

  xterm -fa 'UbuntuBeta Mono'

Barry Warsaw (barry) wrote :

Something must have just recently changed to cause this (yes, it's happening for me too). On Natty, I've been using the Ubuntu Beta Mono 17 font in Emacs and Terminal for months now, and it's been awesome, modulo the Emacs bug where it can't handle the '17' at the end of the font name. But anyway, although I've been consistently keeping my desktops updated, just today I did an update and all the fonts started looking terrible. I rebooted and now it looks like the font name has changed because both Terminal and Emacs couldn't find the UBM font. Okay, it looks like they're now called 'UbuntuBeta Mono'. So after changing this in Terminal's profile editor and in my elisp files, Terminal looks good but Emacs only has the italics font. The emacs23 package hasn't changed recently so something in the font must be triggering this problem.

Barry Warsaw (barry) wrote :

Also note that something about the horizontal size has drastically changed. An 80 character wide Emacs window is now significantly narrower than it was with the '17' version.

James Ferguson (jamesf) wrote :

Contrary to Lukas's experience (comment #5), when I tell emacs to use Inconsolata, it works just fine. I haven't seen it with any other fonts. Though it does seem to be something specific between the font and Emacs.

My current workaround is to delete the bold & italic ttf files for now, just to get my favorite font where I spend 80% of my time.

Paul Sladen (sladen) wrote :

Barry: "UbuntuBeta Mono" is the current iteration of the monospace betas and is what we've been collectively testing since UDS. Following an oversight(?), this revision hadn't landed in the natty pocket of the internal Canonical 'walled-garden' PPA. Mark pointed out that he wasn't seeing it either this out this morning, and after I eventually tracked it down I forced the copy from the beta-testing/natty PPA over the top of the Canonical walled-garden/natty PPA. This removes all of the other earlier stale/broken/experimental/alphas and the beta will be what you've got following a reboot;

The Emacs number-at-end-of-font-name is bug #697412 ("Emacs won't start, complaining about font ending in a number") and was fixed upstream in Emacs, although this may not have filtered down yet.

The size/scaling/line-counts are covered in bug #727733 ("Technical: Mono: discern level of scaling to fit in terminal cell") which IIRC you've previously participated in/subscribed to. An attachment at:

  https://bugs.launchpad.net/ubuntu-font-family/+bug/727733/+attachment/1893352/+files/ubuntu-mono-nominal-size-r17-r21.pdf

shows the relative scaling, and the line-count options that were investigated following your report. The middle option of 100/112.0 scaling was chosen, giving a 2:1 ration, good line-spacing and a reasonable line-count at a slightly differentiated x-height compared to the proportional members of the Ubuntu Font Family.

This bug: the alphas did not contain a proper bold-italic. The inclusion of UbuntuBeta Mono Bold-Italic has therefore only been available during the beta.

Paul Sladen (sladen) wrote :

James: is it necessary to delete the Bold and Italic .ttfs, or just the Bold-Italic (the fourth variant)?

Paul Sladen (sladen) on 2011-06-14
summary: - Emacs: choosing normal monospace font in Emacs but gives bolded italic
+ Emacs: choosing normal monospace font in Emacs but gives bold-italic
Barry Warsaw (barry) wrote :

@Paul, thanks for the explanation. I'm sure I can adjust to the sizing changes, especially since Unity already breaks geometry hints, so I have to move windows around manually anyway :). It *was* great to see that vertical line counts weren't sacrificed, so I think it's a pretty good trade-off.

As for this bug, are you saying that the "sudden" inclusion of a proper bold-italic font has tickled a lurking bug in Emacs?

Paul Sladen (sladen) wrote :

Interesting, whole looking into bug #797471, I noticed the following:

  $ for f in /usr/share/fonts/truetype/ubuntu-font-family/UbuntuBetaMono-*.ttf ; do basename $f | tr \\n \\t ; showttf $f | awk '/avgWidth/{print$1}' ; done | sort -t= -nk2
  UbuntuBetaMono-BI.ttf avgWidth=499
  UbuntuBetaMono-B.ttf avgWidth=500
  UbuntuBetaMono-RI.ttf avgWidth=500
  UbuntuBetaMono-R.ttf avgWidth=500

One of these, is not like the others.

James Jesudason (jamesj) wrote :

Paul: I've found that the problem is resolved by just deleting the bold-italic font from /usr/share/fonts/truetype/ubuntu-font-family.

Vincent Ladeuil (vila) wrote :

I encounter the same issue on natty.

I use a slightly different way to select the font (in case it matters). I use

  (setq my-default-font "-unknown-UbuntuBeta Mono-normal-normal-*-14-*-*-*-*-0-iso10646-1")

which ultimately ends up in default-frame-alist

Note that I previously used:

  (setq my-default-font "-unknown-Ubuntu Beta Mono 21-normal-normal-*-14-*-*-*-*-0-iso10646-1")

Deleting the bold-italic font from /usr/share/fonts/truetype/ubuntu-font-family made it work again, so +1 on the workaround.

Paul Sladen (sladen) on 2011-06-16
description: updated
description: updated
Vincent Ladeuil (vila) wrote :

Hmm it looks like I missed a detail there: it seems the switch from 'Ubuntu Beta Mono 21' to 'UbuntuBeta Mono' also means I went from 79 to 74 lines on a 24" display (aka 1920x1200, taking into account that I leave some empty space at the bottom of the screen).

Is this caused by a change in the font itself or a spacing issue between lines (which may be not come directly from the font) ?

Vincent Ladeuil (vila) wrote :

Bah, more info:

86 lines with "-adobe-courier-medium-r-*-*-12-*-*-*-m-*-iso8859-1"
79 lines with "-unknown-Ubuntu Beta Mono 21-normal-normal-*-14-*-*-*-*-0-iso10646-1"
74 lines with "-unknown-UbuntuBeta Mono-normal-normal-*-14-*-*-*-*-0-iso10646-1"

I hope there is a way to invert the trend ;)

Triwanto Simanjuntak (lu176) wrote :

The workaround works for me as well. Finally I can enjoy using the lovely Ubuntu Monospace font in my favorite Editor.

Paul Sladen (sladen) wrote :

Vincent: Regarding line-counts and scaling, are the answers in comment #13 (above), and bug #727733 ("Technical: Mono: discern level of scaling to fit in terminal cell") sufficient? I can explain in more detail if required.

Vincent Ladeuil (vila) wrote :

@paul: Ok, after reading bug #727733 I realised I've been out of the loop.

My preference was for Ubuntu Mono Beta 21 but I understand why this wasn't the chosen one.

I'm currently trying:
 79 lines with "-unknown-UbuntuBeta Mono-normal-normal-*-13-*-*-*-*-0-iso10646-1"

It's a bit small and less pleasing than Beta 21, but still good enough for daily use (did I mention I love this font ?).

I wish there was an easy way to override some simple setting to reduce the line spacing. I fully understand this may get ugly if I ever try to display accented capitals but since I almost never encounter this case I don't really care ;)

Unless you tell me there could be such a trick, I'll leave it at that.

On Jun 17, 2011, at 06:44 AM, Vincent Ladeuil wrote:

>@paul: Ok, after reading bug #727733 I realised I've been out of the
>loop.
>
>My preference was for Ubuntu Mono Beta 21 but I understand why this
>wasn't the chosen one.
>
>I'm currently trying:
> 79 lines with "-unknown-UbuntuBeta Mono-normal-normal-*-13-*-*-*-*-0-iso10646-1"
>
>It's a bit small and less pleasing than Beta 21, but still good enough
>for daily use (did I mention I love this font ?).
>
>I wish there was an easy way to override some simple setting to reduce
>the line spacing. I fully understand this may get ugly if I ever try to
>display accented capitals but since I almost never encounter this case I
>don't really care ;)
>
>Unless you tell me there could be such a trick, I'll leave it at that.

I'm with you Vila, though I really liked the squashed look of 17 best :).
I've taken to bumping up to 14 point, which loses some vertical space. It
seems a good trade-off though since this is such a pleasant font to code with.

-B

Dimitri John Ledkov (xnox) wrote :

running the sscript from bug 788757 against BI is better, cause then you get monospace regular but still have bold+italic in Emacs when needed.

Jonathan Lange (jml) wrote :

Is there a reason this bug is marked Incomplete? Does something need to be reproduced or confirmed that I could with?

It would be great to go back to using Ubuntu monospace for my daily work, and as such I'd like to do what I can to help resolve this issue.

Paul Sladen (sladen) wrote :

jml: this should be fixed by an update from Dalton Maag. codeman38's script does fix; need to diff the result and confirm that the same changes are carried over in the fixed version from DM.

On Sep 06, 2011, at 07:05 PM, Paul Sladen wrote:

>jml: this should be fixed by an update from Dalton Maag. codeman38's
>script does fix; need to diff the result and confirm that the same
>changes are carried over in the fixed version from DM.

Yay! I'm happy to test it.

Jonathan Lange (jml) wrote :

Just tried with latest version (0.71.2-0ubuntu7+phasedbeta7+mono+condensed+arabic). Still see the same behaviour. Can't find codeman38's script at all.

Paul Sladen (sladen) wrote :

jml: the mono haven't been updated. codeman38's script can be found on bug #788757:

  https://bugs.launchpad.net/ubuntu-font-family/+bug/788757/+attachment/2151526/+files/fixboxdraw-ft.py

Barry Warsaw (barry) wrote :

I ran the script over all the .ttf files in /usr/share/fonts/truetype/ubuntu-font-family, and replaced them all with the 'fixed' versions. Most of the on-screen fonts looked horrible (this included the greeter fonts, menus, and various dialogs). However, it did kind of fix the Emacs bug.

Then I restored all of the original (i.e. "unfixed") fonts except UbuntuBetaMono-BI.ttf (the original troublemaker). This fixed all the system fonts, and also allowed the Emacs default font to work properly. The only problem I found then was that all italic-regular fonts in Emacs were rendered as italic-bold.

Just for the record, I am using a pure Debian sid system (updated twice per day) and the font package version 0.71.2-0ubuntu7+phasedbeta7+mono+condensed.

I get this problem of an italic bold with plain xterm (having just installed the font package). OTOH, rxvt-unicode doesn't have this problem, but the font looks a little bit strange with a pure

    urxvt -fn 'xft:UbuntuBeta Mono'

because the bold text with an urxvt with the command above doesn't seem to be using bold fonts (this may be due to me not configuring things correctly yet).

And JFTR#2, in my systems I use all terminals with black backround and white colors (contrary to, say, gnome-terminal defaults).

Regards,

Rogério Brito.

Jonathan Lange (jml) wrote :

On Wed, Sep 7, 2011 at 11:25 AM, Paul Sladen <email address hidden> wrote:
> jml: the mono haven't been updated.  codeman38's script can be found on
> bug #788757:

Will you update the bug when it is updated? Am very keen to have
Ubuntu Mono in Emacs. (Also, probably because I don't know the
internal process, I thought that "should be fixed by an update from
Dalton Maag" meant it *had* been updated.)

jml

Paul Sladen (sladen) wrote :

jml: I believe it is fixed in the build that Dalton Maag have internally (and has been for several months), but has not been made available for testing yet.

Paul Sladen (sladen) on 2011-09-19
Changed in ubuntu-font-family:
milestone: none → 0.80
Paul Sladen (sladen) wrote :

Fix committed by Malcolm Wooden/Vincent Connare in 0.80~rc.

Changed in ubuntu-font-family:
status: Incomplete → Fix Committed
Vincent Ladeuil (vila) wrote :

0.80~rc tested, the previous workaround is not needed any more (deleting the UbuntuBetaMono-BI.ttf).

I am an happy camper, thanks !

Paul Sladen (sladen) wrote :

2011-09-22 (Paul Sladen) Ubuntu Font Family version 0.80

  [Vincent Connare/Dalton Maag]
  * Wish for addition of a monospaced member to the family (LP: #640382)
  * Mono: No hinting yet - Ubuntu Beta Mono font looks jagged in
    Netbeans and terrible with ClearType (LP: #820493)
  * Emacs: choosing normal monospace font in Emacs but gives bold-italic
    (LP: #791076)
  * PUA: ensure that Ubuntu Circle of Friends logo is full size: (LP: #853855)
    + U+E0FF becomes large size in proportionals, remains small width in
      monospaces
    + U+F0FF becomes small size (proportionals only)
    + U+F200 is full ubuntu logomark (proportionals only)

  [Paul Sladen]
  * Monospace: Patch Family Name to be "Ubuntu Mono"
  * Monospace: Patch U+EFFD version debugging glyph to be '0.8'

  [Cody Boisclair]
  * Monospace: Force .null HDMX advance to 500
  * Monospace: Remap ASCII box-drawing characters (LP: #788757)

  [Júlio Reis]
  * Date corrections to 'FONTLOG' (LP: #836595)

Changed in ubuntu-font-family:
milestone: 0.80 → none
status: Fix Committed → Fix Released
milestone: none → 0.80
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.