LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-07-2021, 01:49 AM   #16
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,297

Original Poster
Rep: Reputation: 230Reputation: 230Reputation: 230

This is a help window containing the entire alphabet after switching Window Maker from Trebuchet MS to Cantarell font:

Click image for larger version

Name:	lq-font.png
Views:	8
Size:	13.3 KB
ID:	36322

(In the above example, I used the mimorek’s code with chr(9) tabs).

Here is a comparison between Trebuchet MS and Cantarell fonts:

Click image for larger version

Name:	Trebuchet-Cantarell.png
Views:	6
Size:	30.7 KB
ID:	36323

When looking at the letters J, K, or Q in both images, it becomes obvious that the help window does not use Trebuchet or Cantarell fonts. The font set in the Window Maker preferences is used only on the window title bar. The font used in the window is independent of Window Maker.
 
Old 05-07-2021, 02:23 AM   #17
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 2,321

Rep: Reputation: Disabled
Perhaps, Changing the UI font for LibreOffice in Linux will help.
 
Old 05-07-2021, 09:03 AM   #18
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,297

Original Poster
Rep: Reputation: 230Reputation: 230Reputation: 230
@shruggy

Yesterday evening I was very tired and fixated on your post #11 and Cantarell font.

* * *

Today I returned to your previous posts #9 and #13.

Now I can see you are right my Apache OpenOffice uses the DejaVu Sans font.

I checked my ~/GNUstep/Defaults/WindowMaker file. It lacked a definition for DisplayFont, so I added it:

Code:
DisplayFont = "Cantarell:slant=0:weight=80:width=100:pixelsize=12";
Then I used the Chuan Ji How To available here: https://jichu4n.com/posts/how-to-set...ases-on-linux/

As a result, I created the ~/.config/fontconfig/fonts.conf file:

Code:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

  <alias>
    <family>Cantarell</family>
    <prefer>
      <family>sans-serif</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Cantarell</family>
    </prefer>
  </alias>

  <match>
    <test name="family"><string>Times New Roman</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Liberation Serif</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Arial</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Liberation Sans</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Courier New</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Cousine</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Courier</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Cousine</string>
    </edit>
  </match>

  <match>
    <test name="family"><string>Cambria</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Caladea</string>
    </edit>
  </match>
  <match>
    <test name="family"><string>Calibri</string></test>
    <edit name="family" mode="assign" binding="strong">
      <string>Carlito</string>
    </edit>
  </match>

</fontconfig>
I mentioned earlier that I installed the Cantarell font from SlackBuilds on my system and changed Window Maker preferences to use Cantarell. As this font is in OTF format, to avoid potential problems, today I converted it to TTF using fontforge, removed the OTF version and installed TTF.

After these changes and a system restart, Apache OpenOffice still uses the DejaVu Sans font and the fc-match output is the same as before:

Code:
$  fc-match sans-serif
DejaVuSans.ttf: "DejaVu Sans" "Book"
Chuan Ji mentioned in his How To that generic family aliases can cause problems:

Quote:
Aliasing to generic families (serif, sans-serif etc.) may or may not work depending on your configuration in /etc/fonts (they didn’t work for me), so it’s safer this way.
As you can see, I have done a lot of work and I am still in the same place.

* * *

Regarding your post #17, I will come back to it later.

* * *

EDITED:

I just checked the Courier New font:

Quote:
fc-match "Courier New"
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
According to my configuration in the ~/.config/fontconfig/fonts.conf file it should be the Cousine font but it is the Liberation Mono font according to the /etc/fonts/conf.avail/60-liberation.conf file. So my configuration has no priority over system configuration.

As a result, I did a lot and gained nothing.

Last edited by w1k0; 05-07-2021 at 09:27 AM.
 
Old 05-07-2021, 12:02 PM   #19
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,297

Original Poster
Rep: Reputation: 230Reputation: 230Reputation: 230
@shruggy

I followed the link from your post #17.

Since I do not know what I should put in the /.config/libreoffice/4/user/registrymodifications.xcu file, I modified the /opt/openoffice4/share/registry/main.xcd file by replacing all “DejaVu Sans;” strings with “Cantarell;”.

After this modification, Apache OpenOffice still uses the DejaVu Sans font.

Capitulate:

• WindowMaker Preferences using the Cantarell font only in the /GNUstep/Defaults/WindowMaker file did not change anything;

• The ~/.config/fontconfig/fonts.conf file using Cantarell font does not work for some reason;

• Modified /opt/openoffice4/share/registry/main.xcd file using only Cantarell font does not affect Apache OpenOffice.

It is very frustrating.
 
Old 05-07-2021, 03:06 PM   #20
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,297

Original Poster
Rep: Reputation: 230Reputation: 230Reputation: 230
For now, I have added the following excuse to the README and README.4.MACROS files:

Quote:
the help displayed by OpenOffice Writer might look ugly because I formatted it manually by putting more or less spaces between the first and second columns – as a result, OpenOffice using a font other than DejaVu Sans used in my version will display the text in the second column not aligned at all; unfortunately other text formatting methods like using tabs do not work the same on different Linux distributions using different window managers or desktop environments
 
Old 05-08-2021, 07:00 AM   #21
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,297

Original Poster
Rep: Reputation: 230Reputation: 230Reputation: 230
Eventually I decided to use tabs instead of spaces to separate columns in the help window. This code is easier to improve if someone is using OpenOffice or LibreOffice that use a better font.

As a result, my comment on the help window now looks like this:

Quote:
the help displayed by OpenOffice or Libre Office Writer may look ugly because I formatted it manually by placing more or fewer tabs between the first and second columns – as a result, Writer using different fonts displays more or less aligned text in the second column; unfortunately, different Linux distributions working with different window managers or desktop environments use different fonts – some may display aligned text in the message box columns, while others do not; if you notice that the anomalies in the help window form some regular pattern, you can try adding or removing a few tabs here and there to improve the appearance of the help window on your system

Last edited by w1k0; 05-08-2021 at 07:03 AM.
 
Old 05-08-2021, 12:08 PM   #22
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,297

Original Poster
Rep: Reputation: 230Reputation: 230Reputation: 230
In desperation, I removed all DejaVu fonts from the /opt/openoffice4/share/fonts/truetype directory and uninstalled the dejavu-fonts-ttf-2.34 package from Slackware. As a result, OpenOffice displayed the macro help window using some other font that I could not identify – and despite all my efforts outlined above, it was not Cantarell. Unfortunately, the right column of the text was misaligned as before. So I brought back the DejaVu fonts and stopped worrying about the macro help looking ugly. Incidentally, the problem described here still remains unsolved.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
merge columns from multiple files in a directory based on match of two columns prasanthi yanamala Linux - Newbie 2 11-12-2015 10:11 AM
SQL statements howto -- 3 columns input but 2 columns output fhleung Programming 3 11-29-2012 10:45 AM
Map 1 CSV's columns to matching columns in another CSV 2legit2quit Programming 7 10-27-2011 08:53 AM
[SOLVED] AWK: add columns while keep format for other columns cristalp Programming 3 10-13-2011 06:14 AM
msgbox and time measuring sytax under ubuntu cyb3rdawn Programming 1 05-22-2008 04:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration