* Using Variable Width Fonts for org-mode and Fixed Width for Tables
@ 2013-09-26 13:51 Ian Barton
2013-09-27 7:19 ` Using Variable Width Fonts for org-mode and Fixed Width forTabless Alan Schmitt
0 siblings, 1 reply; 5+ messages in thread
From: Ian Barton @ 2013-09-26 13:51 UTC (permalink / raw)
To: emacs-orgmode@gnu.org mode
I am struggling to get this to work. In my init files I have:
(set-default-font "DejaVu Serif Italic")
I have followed the advice on StackOverflow
http://stackoverflow.com/questions/3758139/variable-pitch-for-org-mode-fixed-pitch-for-tables
and customized my Init file to include:
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
However, table formatting is still screwed up. C-u C-x = shows
xft:-unknown-IM FELL DW
Pica-normal-italic-normal-*-15-*-*-*-*-0-iso10646-1 (#x29)
Character code properties: customize what to show
name: LATIN CAPITAL LETTER F
general-category: Lu (Letter, Uppercase)
decomposition: (70) ('F')
There are text properties here:
face org-table
fontified t
line-prefix [Show]
wrap-prefix [Show]
I have tried setting the font for org-table using Emacs Customize
Interface, but without any success. Ideally I want tables to use a
monospace font like Inconsolata or DejaVu mono. Can anyone provide an
example of how to set org-table to use a specified fixed width font.
Ian.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Using Variable Width Fonts for org-mode and Fixed Width forTabless
2013-09-26 13:51 Using Variable Width Fonts for org-mode and Fixed Width for Tables Ian Barton
@ 2013-09-27 7:19 ` Alan Schmitt
2013-10-02 8:28 ` Ian Barton
0 siblings, 1 reply; 5+ messages in thread
From: Alan Schmitt @ 2013-09-27 7:19 UTC (permalink / raw)
To: ian; +Cc: emacs-orgmode@gnu.org mode
Hi Ian,
lists@wilkesley.net writes:
> I am struggling to get this to work. In my init files I have:
>
> (set-default-font "DejaVu Serif Italic")
>
> I have followed the advice on StackOverflow
> http://stackoverflow.com/questions/3758139/variable-pitch-for-org-mode-fixed-pitch-for-tables
> and customized my Init file to include:
>
> (set-face-attribute 'org-table nil :inherit 'fixed-pitch)
>
> However, table formatting is still screwed up. C-u C-x = shows
>
> xft:-unknown-IM FELL DW
> Pica-normal-italic-normal-*-15-*-*-*-*-0-iso10646-1 (#x29)
>
> Character code properties: customize what to show
> name: LATIN CAPITAL LETTER F
> general-category: Lu (Letter, Uppercase)
> decomposition: (70) ('F')
>
> There are text properties here:
> face org-table
> fontified t
> line-prefix [Show]
> wrap-prefix [Show]
>
> I have tried setting the font for org-table using Emacs Customize
> Interface, but without any success. Ideally I want tables to use a
> monospace font like Inconsolata or DejaVu mono. Can anyone provide an
> example of how to set org-table to use a specified fixed width font.
I've played a little with this, and here is what I have (straight from
my config file).
First, I set up the font for variable pitch, and I tell emacs to use it
for text modes.
** setup
#+BEGIN_SRC emacs-lisp
(set-face-attribute 'variable-pitch nil :family "Ubuntu")
(set-face-attribute 'variable-pitch nil :height 140)
(add-hook 'text-mode-hook 'variable-pitch-mode)
#+END_SRC
Then I set up exceptions for some faces in some modes. I have exceptions
for info, mu4e, and org mode. Here are the ones for org mode.
** org
from http://yoo2080.wordpress.com/2013/05/30/monospace-font-in-tables-and-source-code-blocks-in-org-mode-proportional-font-in-other-parts/
#+BEGIN_SRC emacs-lisp
(defun my-adjoin-to-list-or-symbol (element list-or-symbol)
(let ((list (if (not (listp list-or-symbol))
(list list-or-symbol)
list-or-symbol)))
(require 'cl-lib)
(cl-adjoin element list)))
(mapc
(lambda (face)
(set-face-attribute
face nil
:inherit
(my-adjoin-to-list-or-symbol
'fixed-pitch
(face-attribute face :inherit))))
(list 'org-code 'org-block 'org-table 'org-block-background 'org-date 'org-link 'org-footnote))
#+END_SRC
What this says is: use fixed-pitch for the faces in the list at the
end. I have to include dates, links, and footnotes because I use them in
tables and I don't know how to conditionally change a face (i.e., use
fixed-pitch for links in tables but not for links in other places).
Hopefully this will work for you.
Alan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Using Variable Width Fonts for org-mode and Fixed Width forTabless
2013-09-27 7:19 ` Using Variable Width Fonts for org-mode and Fixed Width forTabless Alan Schmitt
@ 2013-10-02 8:28 ` Ian Barton
2013-10-02 9:10 ` Using Variable Width Fonts for org-mode and Fixed WidthforTablesss Alan Schmitt
0 siblings, 1 reply; 5+ messages in thread
From: Ian Barton @ 2013-10-02 8:28 UTC (permalink / raw)
To: emacs-orgmode
On 27/09/13 08:19, Alan Schmitt wrote:
> Hi Ian,
>
> lists@wilkesley.net writes:
>
>> I am struggling to get this to work. In my init files I have:
>>
>> (set-default-font "DejaVu Serif Italic")
>>
>> I have followed the advice on StackOverflow
>> http://stackoverflow.com/questions/3758139/variable-pitch-for-org-mode-fixed-pitch-for-tables
>> and customized my Init file to include:
>>
>> (set-face-attribute 'org-table nil :inherit 'fixed-pitch)
>>
>> However, table formatting is still screwed up. C-u C-x = shows
>>
>> xft:-unknown-IM FELL DW
>> Pica-normal-italic-normal-*-15-*-*-*-*-0-iso10646-1 (#x29)
>>
>> Character code properties: customize what to show
>> name: LATIN CAPITAL LETTER F
>> general-category: Lu (Letter, Uppercase)
>> decomposition: (70) ('F')
>>
>> There are text properties here:
>> face org-table
>> fontified t
>> line-prefix [Show]
>> wrap-prefix [Show]
>>
>> I have tried setting the font for org-table using Emacs Customize
>> Interface, but without any success. Ideally I want tables to use a
>> monospace font like Inconsolata or DejaVu mono. Can anyone provide an
>> example of how to set org-table to use a specified fixed width font.
>
> I've played a little with this, and here is what I have (straight from
> my config file).
>
> First, I set up the font for variable pitch, and I tell emacs to use it
> for text modes.
>
> ** setup
> #+BEGIN_SRC emacs-lisp
> (set-face-attribute 'variable-pitch nil :family "Ubuntu")
> (set-face-attribute 'variable-pitch nil :height 140)
>
> (add-hook 'text-mode-hook 'variable-pitch-mode)
> #+END_SRC
>
> Then I set up exceptions for some faces in some modes. I have exceptions
> for info, mu4e, and org mode. Here are the ones for org mode.
>
> ** org
> from http://yoo2080.wordpress.com/2013/05/30/monospace-font-in-tables-and-source-code-blocks-in-org-mode-proportional-font-in-other-parts/
>
> #+BEGIN_SRC emacs-lisp
> (defun my-adjoin-to-list-or-symbol (element list-or-symbol)
> (let ((list (if (not (listp list-or-symbol))
> (list list-or-symbol)
> list-or-symbol)))
> (require 'cl-lib)
> (cl-adjoin element list)))
>
> (mapc
> (lambda (face)
> (set-face-attribute
> face nil
> :inherit
> (my-adjoin-to-list-or-symbol
> 'fixed-pitch
> (face-attribute face :inherit))))
> (list 'org-code 'org-block 'org-table 'org-block-background 'org-date 'org-link 'org-footnote))
> #+END_SRC
>
> What this says is: use fixed-pitch for the faces in the list at the
> end. I have to include dates, links, and footnotes because I use them in
> tables and I don't know how to conditionally change a face (i.e., use
> fixed-pitch for links in tables but not for links in other places).
>
> Hopefully this will work for you.
>
> Alan
>
Hi Alan,
That sort of works. The fonts in org-table, etc are fixed pitch as
expected. However, I seem unable to set a variable width font using
text-mode-hook. Whatever font I choose Emacs ends up using DejaVu Sans
Mono. I have tried several fonts that Emacs should be able to use by
listing them with (print (font-family-list)).
If I set the font instead using set-default-font org-table, etc claim
they are using a fixed pitch font, but they don't look as though they are.
Ian.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Using Variable Width Fonts for org-mode and Fixed WidthforTablesss
2013-10-02 8:28 ` Ian Barton
@ 2013-10-02 9:10 ` Alan Schmitt
2013-10-02 10:34 ` Ian Barton
0 siblings, 1 reply; 5+ messages in thread
From: Alan Schmitt @ 2013-10-02 9:10 UTC (permalink / raw)
To: ian; +Cc: emacs-orgmode
Hi Ian,
lists@wilkesley.net writes:
> That sort of works. The fonts in org-table, etc are fixed pitch as
> expected. However, I seem unable to set a variable width font using
> text-mode-hook. Whatever font I choose Emacs ends up using DejaVu Sans
> Mono.
Is it because the "variable-pitch-mode" is not set, or because the face
associated with it is not applied? What happens when you do a "M-x
variable-pitch-mode"?
Alan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Using Variable Width Fonts for org-mode and Fixed WidthforTablesss
2013-10-02 9:10 ` Using Variable Width Fonts for org-mode and Fixed WidthforTablesss Alan Schmitt
@ 2013-10-02 10:34 ` Ian Barton
0 siblings, 0 replies; 5+ messages in thread
From: Ian Barton @ 2013-10-02 10:34 UTC (permalink / raw)
To: emacs-orgmode
On 02/10/13 10:10, Alan Schmitt wrote:
> Hi Ian,
>
> lists@wilkesley.net writes:
> ur help.
>> That sort of works. The fonts in org-table, etc are fixed pitch as
>> expected. However, I seem unable to set a variable width font using
>> text-mode-hook. Whatever font I choose Emacs ends up using DejaVu Sans
>> Mono.
>
> Is it because the "variable-pitch-mode" is not set, or because the face
> associated with it is not applied? What happens when you do a "M-x
> variable-pitch-mode"?
>
> Alan
>
Aha! As you suggest variable-pitch-mode isn't being set. Doing an "M-x
variable-pitch-mode" sets the font correctly. So either text-mode-hook
isn't being called, or something is resetting it.
[Time passes...]
Just had a look through my .emacs and I was using text-mode-hook later
on to turn on autofill. So problem solved, thanks very much for your help.
Ian.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-02 10:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-26 13:51 Using Variable Width Fonts for org-mode and Fixed Width for Tables Ian Barton
2013-09-27 7:19 ` Using Variable Width Fonts for org-mode and Fixed Width forTabless Alan Schmitt
2013-10-02 8:28 ` Ian Barton
2013-10-02 9:10 ` Using Variable Width Fonts for org-mode and Fixed WidthforTablesss Alan Schmitt
2013-10-02 10:34 ` Ian Barton
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.