Bug 247700 - RSE Terminal uses ugly fonts in JEE package
Summary: RSE Terminal uses ugly fonts in JEE package
Status: CLOSED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: Terminal (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0.3   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 247698 259363 265352
  Show dependency tree
 
Reported: 2008-09-17 13:58 EDT by Martin Oberhuber CLA
Modified: 2009-02-24 10:03 EST (History)
2 users (show)

See Also:


Attachments
Patch fixing the issue (8.47 KB, patch)
2009-02-18 10:55 EST, Martin Oberhuber CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2008-09-17 13:58:25 EDT
+++ This bug was initially created as a clone of Bug #247698 +++

Testing JEE SR1 RC1:

Window > Open Perspective > Remote Systems
New Connection > SSH Only
select "Terminals" subsystem, right-click > Launch Terminal

The Terminal shows with a proportional font expanded to look monospaced. This is correct in terms of rendering, but looks ugly and what's worse: The user cannot change the font.

Workaround : 
------------
Help > Software Updates ... > Target Management 3.0 Updates >
Install the "TM Terminal SDK" feature. 

The font changes to the Text Editor font, and Preferences > Appearance > Colors and Fonts > Terminal can be used to change the font.

The Problem:
------------
There are two distinct problems:
(1) The Font Preference is declared in the tm.terminal.view plugin which is
    not installed in JEE, therefore there is no Control to change the 
    Preference. We either need to move the org.eclipse.ui.themes extension
    into the Terminal Widget, or create an org.eclipse.ui.themes extension
    in the RSETerminal.
(2) In the Terminal, StyleMap.java uses the hard-coded Preference slot for
    reading the font to use. I think that we'll need API like
       StyleMap#setFontName(String)
    in order to change the font in a specific StyleMap. Then, multiple 
    different clients can each pick their own font if they want, and 
    set it through ITerminalViewControl#setFont(Font).

User Impact:
------------
I'm not yet sure whether we actually want different views adopting the Terminal Widget to use different Preference slots for setting the font, but I think we should make the API change anyways in order to allow different Terminal Instances to use different fonts (users might want a very narrow font in a widget that needs to display many columns, and a large font in a nother terminal widget).

Quick fix for maintenance branch:
---------------------------------
For a quick fix in the maintenance branch, we'll likely just want to duplicate the relevant plugin.xml code from tm.terminals.view into rse.terminals.ui such that both plugins are aware of the Preference, and add an IPropertyChangeListener to the rse.terminals.ui
Comment 1 Martin Oberhuber CLA 2008-09-27 18:01:28 EDT
After some discussion, we think that we need to allow different views which embed the Terminal Widget to use different fonts.

For the currently known clients, the Terminal View should keep its existing Preference setting (at least for now). For RSE Terminal, a new Preference Setting will be added in "Window > General > Appearance > Colors and Fonts > Remote Systems > Terminals", set to use the Text Editor Font by default.
Comment 2 Martin Oberhuber CLA 2008-09-30 09:18:00 EDT
bulk update of target milestone
Comment 3 Martin Oberhuber CLA 2009-02-18 10:55:59 EST
Created attachment 126034 [details]
Patch fixing the issue

We cannot add UI or externalized Strings in 3.0.3 -- therefore, attached patch keeps the current mode of operation in the Terminal ("pulling" a hardcoded font name), but adds fallbacks:

  - by default, use the "Terminal View Font"
  - if not available, use the "Remote Shell Font"
  - if also not available, us the "Default Text Font"

The patch also improves the handling of semi-proportional fonts such as Microsoft "Lucida Console", which are fixed-size in regular style, but bold style is wider. For 3.1, we'll want to further improve the fix by allowing to programmatically push the font into a terminal widget rather than pulling it out of the font registry.
Comment 4 Martin Oberhuber CLA 2009-02-18 11:16:14 EST
Released for TM 3.0.3
Comment 5 Martin Oberhuber CLA 2009-02-18 13:08:59 EST
For TM 3.1, we'll want to improve the solution through bug 265352.
We'll also want to fix bug 220299 along the way.
Comment 6 Martin Oberhuber CLA 2009-02-24 10:03:53 EST
Verified in 20090223-1914_eclipse-jee-ganymede-SR2-RC3-win32.win32.x86.zip