New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 388087 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
vslow; not on Chrome
Closed: Jul 2014
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug



Sign in to add a comment

Use Consolas as the default monospace font on Windows 7 and above

Project Member Reported by cpu@chromium.org, Jun 24 2014

Issue description

Looks better than Courier New and even better of you have DirectWrite.

It is a cleartype optimized font so we should only use it in that case.

 

Comment 1 by cpu@chromium.org, Jun 24 2014

Cc: e...@chromium.org scottmg@chromium.org
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 24 2014

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aac11f4e51859364ff366d74264cf2757aa31b2d

commit aac11f4e51859364ff366d74264cf2757aa31b2d
Author: cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Tue Jun 24 18:27:16 2014

Use Consolas for Windows 7 and above as default monospace font

Looks better that Courier if Cleartype is enabled and much much
better if directwrite is also enabled.

TEST=see bug
BUG= 388087 

Review URL: https://codereview.chromium.org/351523006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279449 0039d316-1c4b-4281-b951-d872f2087c98


Project Member

Comment 3 by bugdroid1@chromium.org, Jun 24 2014

------------------------------------------------------------------
r279449 | cpu@chromium.org | 2014-06-24T18:27:16.624617Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/ui/prefs/prefs_tab_helper.cc?r1=279449&r2=279448&pathrev=279449
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/resources/locale_settings_win.grd?r1=279449&r2=279448&pathrev=279449

Use Consolas for Windows 7 and above as default monospace font

Looks better that Courier if Cleartype is enabled and much much
better if directwrite is also enabled.

TEST=see bug
BUG= 388087 

Review URL: https://codereview.chromium.org/351523006
-----------------------------------------------------------------
Project Member

Comment 4 by bugdroid1@chromium.org, Jun 25 2014

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ac7f8b34f6836ac3d939dad34137f393c5e13114

commit ac7f8b34f6836ac3d939dad34137f393c5e13114
Author: cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Wed Jun 25 04:48:55 2014

Use Consolas for Windows 7 and above as default monospace font

Looks better that Courier if Cleartype is enabled and much much
better if directwrite is also enabled.

TEST=see bug
BUG= 388087 

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=279449

Review URL: https://codereview.chromium.org/351523006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279589 0039d316-1c4b-4281-b951-d872f2087c98


Project Member

Comment 5 by bugdroid1@chromium.org, Jun 25 2014

------------------------------------------------------------------
r279589 | cpu@chromium.org | 2014-06-25T04:48:55.865254Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/ui/prefs/prefs_tab_helper.cc?r1=279589&r2=279588&pathrev=279589

Use Consolas for Windows 7 and above as default monospace font

Looks better that Courier if Cleartype is enabled and much much
better if directwrite is also enabled.

TEST=see bug
BUG= 388087 

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=279449

Review URL: https://codereview.chromium.org/351523006
-----------------------------------------------------------------

Comment 6 by cpu@chromium.org, Jun 25 2014

Status: Started

Comment 7 by ebrami...@gmail.com, Jun 25 2014

This looks good for latin but seems consolas doesn't contains Arabic glyphs, IMO logically monospace should fallback to "courier new" if consolas had not that language glyph coverage.

Comment 8 by ebrami...@gmail.com, Jun 25 2014

* currently is falling back to Tahoma which is not a monospace font
data:text/html;charset=utf8,<div style="font-family: monospace">%D8%B3%DB%8C%D8%B3%DB%8C</div><div style="font-family: courier">%D8%B3%DB%8C%D8%B3%DB%8C</div>

Comment 9 by cpu@chromium.org, Jun 25 2014

ebraminio, interesting. I will ask our local expert. Both consolas and courier new only have Arabic presentation forms, but Courier has A and B while consolas only has B. But our font fallback code should take care of that.


Note that Tahoma is the default monospace font for TH, maybe that is a bug:
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/app/resources/platform_locale_settings/locale_settings_win_th.xtb&q==%22IDS_FIXED_FONT_FAMILY%22%20&sq=package:chromium&type=cs&l=4




Comment 10 by evan@chromium.org, Jun 25 2014

For cpu, here's a snippet of text with a glyph from the Arabic presentation forms A block, followed by the same letter from its more standard place, but also isolated so it ought to render the same:
ﭪ ڤ

U+FB6A ARABIC LETTER VEH ISOLATED FORM vs
U+06A4 ARABIC LETTER VEH


Comment 11 by cpu@chromium.org, Jun 25 2014

Confirmed, m38 (and probably m37) is falling back to tahoma for those two letters while m36 is just using courier. 

m38 looks way better but that I guess is not the intent here.
On my Windows 7, Consolas V5.22 had not Arabic glyphs when I opened it with fontforge. IMO when DW is enabled the font chain should/could be like this: Consolas, Courier new, Tahoma

Comment 13 by evan@chromium.org, Jun 25 2014

Here's the same thing with initial VEH.
These should render the same:
  ﭬـ ڨـ

The same thing with spaces added, should render differently from each other but the one on the right should match the right half of the above renderings:
  ﭬ ـ ڨ ـ

Comment 14 by evan@chromium.org, Jun 25 2014

And here's a screenshot of zoomed-in correct rendering.
Screenshot from 2014-06-25 13:28:58.png
6.7 KB View Download

Comment 15 by evan@chromium.org, Jun 25 2014

Oops, I forgot to include context for my comments.

What my examples are intended to show is whether Consolas's lack of Arabic presentations forms A matters.  If Chrome can render the above correctly while using Consolas, then I think it is safe to use Consolas instead of Courier New.

But if Consolas doesn't have basic Arabic glyphs at all like ebraminio is saying, then you definitely need to fall back on Courier New or whatever.  But I thought Chrome could already do this sort of fallback.

Comment 16 by cpu@chromium.org, Jun 25 2014

#14 on Windows m38

evans_arabic_sample.PNG
2.6 KB View Download

Comment 17 by evan@chromium.org, Jun 25 2014

Looks good to me!  The character on the bottom right is U+FB6C ARABIC LETTER VEH INITIAL FORM which occurs in Arabic Presentations Forms-A, but Chrome is correctly rendering it somehow.

Comment 18 by cpu@chromium.org, Jun 25 2014

Labels: Merge-Requested
requesting merge to 2062

Project Member

Comment 19 by bugdroid1@chromium.org, Jun 25 2014

Labels: merge-merged-2062
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/292d6b95672ee21f40425ecf721ad13c5d708a74

commit 292d6b95672ee21f40425ecf721ad13c5d708a74
Author: cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Wed Jun 25 23:45:58 2014

Merge 279449 "Use Consolas for Windows 7 and above as default mo..."

> Use Consolas for Windows 7 and above as default monospace font
> 
> Looks better that Courier if Cleartype is enabled and much much
> better if directwrite is also enabled.
> 
> TEST=see bug
> BUG= 388087 
> 
> Review URL: https://codereview.chromium.org/351523006

TBR=cpu@chromium.org

Review URL: https://codereview.chromium.org/346763011

git-svn-id: svn://svn.chromium.org/chrome/branches/2062/src@279860 0039d316-1c4b-4281-b951-d872f2087c98


Project Member

Comment 20 by bugdroid1@chromium.org, Jun 25 2014

------------------------------------------------------------------
r279861 | cpu@chromium.org | 2014-06-25T23:49:59.289004Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/2062/src/chrome/browser/ui/prefs/prefs_tab_helper.cc?r1=279861&r2=279860&pathrev=279861

Merge 279589 "Use Consolas for Windows 7 and above as default mo..."

> Use Consolas for Windows 7 and above as default monospace font
> 
> Looks better that Courier if Cleartype is enabled and much much
> better if directwrite is also enabled.
> 
> TEST=see bug
> BUG= 388087 
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=279449
> 
> Review URL: https://codereview.chromium.org/351523006

TBR=cpu@chromium.org

Review URL: https://codereview.chromium.org/352273002
-----------------------------------------------------------------
Project Member

Comment 21 by bugdroid1@chromium.org, Jun 25 2014

------------------------------------------------------------------
r279860 | cpu@chromium.org | 2014-06-25T23:45:58.550739Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/2062/src/chrome/app/resources/locale_settings_win.grd?r1=279860&r2=279859&pathrev=279860
   M http://src.chromium.org/viewvc/chrome/branches/2062/src/chrome/browser/ui/prefs/prefs_tab_helper.cc?r1=279860&r2=279859&pathrev=279860

Merge 279449 "Use Consolas for Windows 7 and above as default mo..."

> Use Consolas for Windows 7 and above as default monospace font
> 
> Looks better that Courier if Cleartype is enabled and much much
> better if directwrite is also enabled.
> 
> TEST=see bug
> BUG= 388087 
> 
> Review URL: https://codereview.chromium.org/351523006

TBR=cpu@chromium.org

Review URL: https://codereview.chromium.org/346763011
-----------------------------------------------------------------
Project Member

Comment 22 by bugdroid1@chromium.org, Jun 25 2014

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/45a60c74980bb8dc0f3549cc8c90ea452496a9fa

commit 45a60c74980bb8dc0f3549cc8c90ea452496a9fa
Author: cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Wed Jun 25 23:49:59 2014

Merge 279589 "Use Consolas for Windows 7 and above as default mo..."

> Use Consolas for Windows 7 and above as default monospace font
> 
> Looks better that Courier if Cleartype is enabled and much much
> better if directwrite is also enabled.
> 
> TEST=see bug
> BUG= 388087 
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=279449
> 
> Review URL: https://codereview.chromium.org/351523006

TBR=cpu@chromium.org

Review URL: https://codereview.chromium.org/352273002

git-svn-id: svn://svn.chromium.org/chrome/branches/2062/src@279861 0039d316-1c4b-4281-b951-d872f2087c98


Great to see this on M-37

However falling back to "Courier New" is also something I hope would be done for M-37. From comparing http://www.microsoft.com/typography/fonts/font.aspx?FMID=2006 to http://www.microsoft.com/typography/fonts/font.aspx?FMID=1723 "Arabic" is not only missing thing, "Hebrew" is also not available on the version I got on Windows 7. Lack of proper monospace glyphs will cause Wikipedia editor and other source editors to look bad without an actual monospace font.
Labels: -Merge-Requested Merge-Approved
Approved for M37 branch merge (note earlier approval was given verbally as well).

Comment 25 by e...@chromium.org, Jun 26 2014

We probably want to resolve the fallback for Arabic and Hebrew before down integrating this...

Comment 26 by evan@chromium.org, Jun 26 2014

I made this layout test with some Hebrew-specific shaping cases.  You could try rendering it with font-family monospace to see if it's affected.

https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/LayoutTests/fast/text/international/hebrew-vowels.html&q=vowe&l=1&sq=package:%5Echromium$%20file:%5Esrc/third_party/WebKit/LayoutTests/fast/

Comment 27 by ebra...@gnu.org, Jul 3 2014

What Visual Studio 2013 on Windows 8 also do on the default Consolas font on Windows 8.1 is also falling back to Courier New for missing scripts.
Not Latin Font.png
13.7 KB View Download
Consolas.png
6.2 KB View Download
Courier New.png
6.2 KB View Download

Comment 28 by cpu@chromium.org, Jul 16 2014

Owner: scottmg@chromium.org
Cc: cpu@chromium.org
Just to recap:
- Courier New has all the glyphs we're concerned with here, so there's no fallback before the default was switched
- Consolas has a smaller set of glyphs, and so falls back to Tahoma

The fallback to tahoma for Arabic happens here: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp&l=95

And per this nearby comment I guess it's never been great https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp&l=242 .

getFontFamilyForScript does not use FontDescription::GenericFamilyType generic == MonospaceFamily which seems to be what we need in this case. So, I guess we could do some hardcoded hackery near here.
e.g. https://codereview.chromium.org/399533002 works for viewing comment #13 above, but it's pretty _Awesome_.

Minor problem: Could potentially break Arabic/Hebrew fallback for a glyph that is in Tahoma, but not in Courier New (we don't have multiple level fallback at this level that I can see). I guess that's fairly unlikely because we would have had people complaining that <whatever> was switching from monospace -> proportional before.

Bigger problem: I have no idea what other script types might require similar handling due to being changed to Consolas.
Project Member

Comment 31 by bugdroid1@chromium.org, Jul 17 2014

The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=178313

------------------------------------------------------------------
r178313 | scottmg@chromium.org | 2014-07-17T04:06:28.932616Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/platform/fonts/win/FontFallbackWin.cpp?r1=178313&r2=178312&pathrev=178313

Add monospace-specific fallback for Hebrew and Arabic from Consolas->Courier New

Potential problems:

- Might break Arabic/Hebrew fallbacks if there are glyphs in Tahoma that aren't in Consolas or Courier New. I used charmap to inspect the unicode ranges that Wikipedia lists under http://en.wikipedia.org/wiki/Hebrew_alphabet and http://en.wikipedia.org/wiki/Arabic_alphabet and I believe Courier New has a full set. So I think this is OK.

- Might be necessary for other scripts too, but I guess we can add more hackery for that if necessary.

- Kind of ugly.

R=eae@chromium.org
BUG= 388087 

Review URL: https://codereview.chromium.org/399533002
-----------------------------------------------------------------
Great to see this fixed, it would be nice if this get merged to M-37 also IMHO.
Project Member

Comment 33 by bugdroid1@chromium.org, Jul 23 2014

Labels: -Merge-Approved
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=178786

------------------------------------------------------------------
r178786 | scottmg@chromium.org | 2014-07-23T22:05:55.286551Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/branches/chromium/2062/Source/platform/fonts/win/FontFallbackWin.cpp?r1=178786&r2=178785&pathrev=178786

Merge 178313 "Add monospace-specific fallback for Hebrew and Ara..."

> Add monospace-specific fallback for Hebrew and Arabic from Consolas->Courier New
> 
> Potential problems:
> 
> - Might break Arabic/Hebrew fallbacks if there are glyphs in Tahoma that aren't in Consolas or Courier New. I used charmap to inspect the unicode ranges that Wikipedia lists under http://en.wikipedia.org/wiki/Hebrew_alphabet and http://en.wikipedia.org/wiki/Arabic_alphabet and I believe Courier New has a full set. So I think this is OK.
> 
> - Might be necessary for other scripts too, but I guess we can add more hackery for that if necessary.
> 
> - Kind of ugly.
> 
> R=eae@chromium.org
> BUG= 388087 
> 
> Review URL: https://codereview.chromium.org/399533002

TBR=scottmg@chromium.org

Review URL: https://codereview.chromium.org/417823002
-----------------------------------------------------------------

Comment 34 by cpu@chromium.org, Jul 24 2014

Status: Fixed

Sign in to add a comment