LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 03-23-2016, 01:55 PM   #1
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: Debian, Crux, LFS, AntiX, NuTyX
Posts: 1,951
Blog Entries: 4

Rep: Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847
I have finally got Abiword to display imported and help text properly


Abiword was designed for compatibility with MSOffice. It has Times New Roman hard-coded into it all over the place. It's not just the templates, which can be edited; it's in the actual program code.

In Dragora, this font doesn't display properly; you just get weird blotches. You can use a different font for newly created text, but all imported ascii text is affected, whether read in from a file or pasted. Worse still, the help files (which are in html) are imported rather than being read by the system's default browser, and they are in Times New Roman too!

I got so sick of this that in the end I downloaded the source code and the build script and bulk-edited the source to replace TNR throughout by Luxi Serif, a font that displays properly. I built and installed the edited version and now I can read imported text files and help files.

Of course this is using a sledgehammer to crack a nut. I shall now need to cautiously reintroduce TNR into the code bit by bit, until I find just which mentions of it are causing the problem. Then I can create a more selective patch, which hopefully will be of use to the Dragora community.
 
Old 03-23-2016, 03:01 PM   #2
offgridguy
Senior Member
 
Registered: Nov 2015
Location: Alberta Canada
Distribution: Windows10, Debian
Posts: 1,111

Rep: Reputation: 147Reputation: 147
I admire your determination.
 
Old 03-25-2016, 11:12 PM   #3
selkfoster
Dragora Maker
(do not blame me)
 
Registered: May 2014
Distribution: Dragora
Posts: 39

Rep: Reputation: 16
Quote:
Originally Posted by hazel View Post
Abiword was designed for compatibility with MSOffice. It has Times New Roman hard-coded into it all over the place. It's not just the templates, which can be edited; it's in the actual program code.

In Dragora, this font doesn't display properly; you just get weird blotches. You can use a different font for newly created text, but all imported ascii text is affected, whether read in from a file or pasted. Worse still, the help files (which are in html) are imported rather than being read by the system's default browser, and they are in Times New Roman too!

I got so sick of this that in the end I downloaded the source code and the build script and bulk-edited the source to replace TNR throughout by Luxi Serif, a font that displays properly. I built and installed the edited version and now I can read imported text files and help files.

Of course this is using a sledgehammer to crack a nut. I shall now need to cautiously reintroduce TNR into the code bit by bit, until I find just which mentions of it are causing the problem. Then I can create a more selective patch, which hopefully will be of use to the Dragora community.
We'll glad to have your suggestions, patch or instructions to have a better Abiword at Dragora. :-)
 
Old 03-28-2016, 10:45 AM   #4
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: Debian, Crux, LFS, AntiX, NuTyX
Posts: 1,951
Blog Entries: 4

Original Poster
Rep: Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847
OK. There are two files that are causing the problem.

src/text/ptbl/xp/pp_Property.cpp pastes ASCII text in Times New`Roman.
src/text/ptbl/xp/pt_PT_Styles.cpp imports ASCII and HTML text.

And here is the patch that I made:

Code:
diff -aur abiword-2.8.6/src/text/ptbl/xp/pp_Property.cpp abiword-2.8.6-new/src/text/ptbl/xp/pp_Property.cpp
--- abiword-2.8.6/src/text/ptbl/xp/pp_Property.cpp	2009-05-19 03:33:18.000000000 +0100
+++ abiword-2.8.6-new/src/text/ptbl/xp/pp_Property.cpp	2016-03-28 15:57:19.853194723 +0100
@@ -99,7 +99,7 @@
 
 	{ "field-color",           "dcdcdc",          true,  NULL, PP_LEVEL_FIELD},
 	{ "field-font",	           "NULL",	          true,  NULL, PP_LEVEL_FIELD},
-	{ "font-family",           "Times New Roman", true,  NULL, PP_LEVEL_CHAR},
+	{ "font-family",           "Luxi Serif", true,  NULL, PP_LEVEL_CHAR},
 	{ "font-size",	           "12pt",	          true,  NULL, PP_LEVEL_CHAR},	// MS word defaults to 10pt, but it just seems too small
 	{ "font-stretch",          "normal",          true,  NULL, PP_LEVEL_CHAR},
 	{ "font-style",	           "normal",          true,  NULL, PP_LEVEL_CHAR},
diff -aur abiword-2.8.6/src/text/ptbl/xp/pt_PT_Styles.cpp abiword-2.8.6-new/src/text/ptbl/xp/pt_PT_Styles.cpp
--- abiword-2.8.6/src/text/ptbl/xp/pt_PT_Styles.cpp	2009-01-04 20:34:28.000000000 +0000
+++ abiword-2.8.6-new/src/text/ptbl/xp/pt_PT_Styles.cpp	2016-03-28 15:26:09.370578973 +0100
@@ -155,7 +155,7 @@
 		s += pCountry;
 	}
 	
-	const char* pszFamily = XAP_App::findNearestFont("Times New Roman",
+	const char* pszFamily = XAP_App::findNearestFont("Luxi Serif",
 													 "normal", "",
 													 "normal", "", "12pt",
 													 s.utf8_str());
@@ -167,7 +167,7 @@
 					  "text-indent:0in; text-position:normal; line-height:1.0; "
 					  "color:000000; bgcolor:transparent; widows:2", pszFamily);
 
-	pszFamily = XAP_App::findNearestFont("Arial", "normal", "",
+	pszFamily = XAP_App::findNearestFont("Luxi Sans", "normal", "",
 										 "normal", "", "12pt", s.utf8_str());
In addition, you might want to bulk-edit the normal.awt files in src/usr/templates.

Last edited by hazel; 03-29-2016 at 01:59 AM. Reason: Put in code brackets
 
  


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
[SOLVED] Slack 14.0 KDE4 korganizer doesn't display imported calender events girvinh Slackware 5 07-29-2013 06:30 PM
How would you convert XML to TEXT or for ABIWORD? Xeratul Linux - General 2 10-15-2011 11:25 AM
how to get text from abiword into a floppy? Uxq Puppy 7 06-15-2007 02:54 PM
Can't open Abiword text editor file - any ideas? everest Linux - General 2 04-04-2007 07:18 PM
Abiword text wrap around picture darin3200 Linux - Software 0 05-20-2004 11:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 07:38 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration