Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 05-18-2010, 01:18 PM   #1
doremifaso
Enthusiast
doremifaso began at the beginning.
 
doremifaso's Avatar
 
Posts: 47
Karma: 10
Join Date: May 2010
Device: PW2, PRS-650, PRS-505
HTML -> EPUB with no embedded fonts

I am trying to convert HTML to EPUB in Calibre with no embedded fonts, but somehow the font information still get saved in the output EPUB file.

This is what I do:
1) I editted the HTML file in MS word and saved it as Web page, filtered.
2) I imported the HTML file with HTML2ZIP set to use encoding cp1252
3) I converted the ZIP file to EPUB without any extra css setting.

Is there something I did wrong in the process? I noticed that the html file I saved in MS word contains tags like @font-face, etc. Is it why the EPUB file get the font information there? How do I remove the font settings when I save the html file?

Thanks!
doremifaso is offline   Reply With Quote
Old 05-18-2010, 02:51 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,154
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
if your input file contains font declarations, your output file will too
kovidgoyal is online now   Reply With Quote
Old 05-18-2010, 04:22 PM   #3
doremifaso
Enthusiast
doremifaso began at the beginning.
 
doremifaso's Avatar
 
Posts: 47
Karma: 10
Join Date: May 2010
Device: PW2, PRS-650, PRS-505
I see. Do you know of a way to remove all the font information in the html file without doing it manually? I have hundreds of html files that I want to convert to epub, and it would be very annoying to fix them one by one manually.
doremifaso is offline   Reply With Quote
Old 05-18-2010, 04:42 PM   #4
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by doremifaso View Post
I see. Do you know of a way to remove all the font information in the html file without doing it manually? I have hundreds of html files that I want to convert to epub, and it would be very annoying to fix them one by one manually.
If there isn't a way in Calibre, you may consider using SED. SED is a Stream EDitor, and will process files to remove or replace strings within them. It's available for unixy and Windows systems.
Starson17 is offline   Reply With Quote
Old 05-18-2010, 10:25 PM   #5
doremifaso
Enthusiast
doremifaso began at the beginning.
 
doremifaso's Avatar
 
Posts: 47
Karma: 10
Join Date: May 2010
Device: PW2, PRS-650, PRS-505
Thanks! I will give it a try.

Do you think if it's possible to add the feature to remove font style in Calibre?
doremifaso is offline   Reply With Quote
Old 05-18-2010, 11:10 PM   #6
doremifaso
Enthusiast
doremifaso began at the beginning.
 
doremifaso's Avatar
 
Posts: 47
Karma: 10
Join Date: May 2010
Device: PW2, PRS-650, PRS-505
What I want to do is I modify the html file to set the headings for chapters, etc. Then, I use Calibre to detect the chapters by "h1", "h2", etc, and then convert it to ePub with no embedded fonts.

The main problem now is the font style is specify in the html as well. However, I want to keep the "h1", "h2" attributes for Calibre to detect the headings. Is there a better way to do this?

Thanks in advance!
doremifaso is offline   Reply With Quote
Old 05-19-2010, 11:19 PM   #7
doremifaso
Enthusiast
doremifaso began at the beginning.
 
doremifaso's Avatar
 
Posts: 47
Karma: 10
Join Date: May 2010
Device: PW2, PRS-650, PRS-505
I have removed all the font style in the html before I convert it to epub in Calibre. But somehow, after the conversion, when I upzip the pub file, I found that in the stylecss file, it contains font style attributes based on the system default font. Am I doing something wrong?

Edit: Actually, I found that the font attributes are added in when I import the html file, and Calibre convert it to ZIP file.

Last edited by doremifaso; 05-19-2010 at 11:21 PM.
doremifaso is offline   Reply With Quote
Old 09-24-2010, 06:46 PM   #8
NicolasR
Addict
NicolasR has a complete set of Star Wars action figures.NicolasR has a complete set of Star Wars action figures.NicolasR has a complete set of Star Wars action figures.NicolasR has a complete set of Star Wars action figures.NicolasR has a complete set of Star Wars action figures.
 
Posts: 257
Karma: 434
Join Date: Feb 2010
Device: none
Thumbs up

Quote:
Originally Posted by doremifaso View Post
Do you think if it's possible to add the feature to remove font style in Calibre?
+1 !

That would be very useful !
I don’t how to erase all these "font-family: "Georgia", "serif";" lines that are in the CSS file in the MsoNormal style (because Word declared the font when exporting to HTML-filtered)…

I have tried to type body {font-family: serif !important;} in the extra CSS field, but nothing happened.
Same thing with .MsoNormal {font-family: serif;} : the font-family: "Georgia", "serif"; lines are not replaced…

If somebody has any idea…
NicolasR is offline   Reply With Quote
Old 09-24-2010, 07:18 PM   #9
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,863
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by NicolasR View Post
That would be very useful !
I don’t how to erase all these "font-family: "Georgia", "serif";" lines that are in the CSS file in the MsoNormal style (because Word declared the font when exporting to HTML-filtered)…

If somebody has any idea…
I have had success by opening the css file in Notepad++ and simply deleting all of the font face code at the beginning of the css file. Some css files had over 10000 lines of font face stuff in the css file.
DoctorOhh is offline   Reply With Quote
Old 09-24-2010, 08:44 PM   #10
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,907
Karma: 5880479
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by dwanthny View Post
I have had success by opening the css file in Notepad++ and simply deleting all of the font face code at the beginning of the css file. Some css files had over 10000 lines of font face stuff in the css file.
You have had those too!.

Those also don't have a clue what "Cascade" means and declare every possible attribute in each and every selector (The newer Webscriptions title's, CSS are pretty ugly compared to the lean-mean older ones , but nowhere close to the 1000 line + level)

It is a LOT of work to clean up after those. In many cases, most of those fonts dont even appear to be used in the document.
theducks is online now   Reply With Quote
Old 09-25-2010, 05:56 AM   #11
NicolasR
Addict
NicolasR has a complete set of Star Wars action figures.NicolasR has a complete set of Star Wars action figures.NicolasR has a complete set of Star Wars action figures.NicolasR has a complete set of Star Wars action figures.NicolasR has a complete set of Star Wars action figures.
 
Posts: 257
Karma: 434
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by dwanthny View Post
I have had success by opening the css file in Notepad++ and simply deleting all of the font face code at the beginning of the css file. Some css files had over 10000 lines of font face stuff in the css file.
Yes, that is what I do… But I have tons of epub to generate from my .doc documents, and I’m pretty sure it would be possible to correct it by using the extra CSS field.

By the way, how can I use it ? Whatever I’m writing in this field, it is never imported in the final epub CSS file…
NicolasR is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
iPad iBooks, ePub, embedded fonts & encryption pdurrant Apple Devices 37 06-08-2010 01:24 PM
Embedded fonts in epub erik5000 ePub 7 12-08-2009 11:55 AM
Opus Opus, ePub and 'embedded' fonts AnemicOak Bookeen 5 11-10-2009 12:21 PM
ePub embedded fonts JSWolf Ectaco jetBook 9 09-14-2009 08:43 PM
ePub + Embedded Fonts Cygfrydd ePub 11 03-02-2009 05:56 PM


All times are GMT -4. The time now is 11:46 AM.


MobileRead.com is a privately owned, operated and funded community.