Bug 265352 - [terminal][api] Terminal widget should allow setting fonts programmatically
Summary: [terminal][api] Terminal widget should allow setting fonts programmatically
Status: RESOLVED 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.4 M7   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on: 247700
Blocks: 315743 378691
  Show dependency tree
 
Reported: 2009-02-18 13:07 EST by Martin Oberhuber CLA
Modified: 2012-05-07 12:21 EDT (History)
2 users (show)

See Also:


Attachments
patch v1 (12.68 KB, patch)
2012-05-07 12:05 EDT, 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 2009-02-18 13:07:17 EST
+++ This bug was initially created as a clone of Bug #247700 +++

The fix for bug 247700 should be improved in the TM 3.1 timeframe.

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).

Proposed Solution:
------------------
* Create API in tm.terminal such that fonts can be changed.
* Use two separate org.eclipse.ui.themes extensions in rse.terminals and tm.terminal.view
* We'll also want to fix bug 220299 along the way.
Comment 1 Martin Oberhuber CLA 2010-02-26 19:10:04 EST
Bulk update of target milestones to 3.2
Comment 2 Martin Oberhuber CLA 2011-05-31 17:42:06 EDT
Moving deferred 3.3 api items to 3.4
Comment 3 Martin Oberhuber CLA 2012-05-07 12:05:36 EDT
Created attachment 215190 [details]
patch v1

Attached patch implements

    ITerminalViewControl#setFont(String fontName)

which takes a fontName from the JFace font registry and pushes the new font all the way through to the StyleMap, which is needed for calculating font grid size.

This should allow setting the Terminal widget to an arbitrary font, including boldface and italic variants.
Comment 4 Martin Oberhuber CLA 2012-05-07 12:06:06 EDT
committed for 3.4 M7.