Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-03-2017, 01:07 PM   #1
Dfaure
Enthusiast
Dfaure began at the beginning.
 
Posts: 31
Karma: 10
Join Date: Jan 2013
Device: Kobo Libra 2 & Aura HD, Cybook Muse
Portable Calibre Viewer and custom fonts

Hi,

I'm using a Portable Calibre for both storing and reading books.

Looking at the application's resource directory, I found a folder with the Liberation font.

I was wondering how I could use my own font set for reading without being obliged to install it in the hosting system?
Dfaure is offline   Reply With Quote
Old 10-03-2017, 01:10 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: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The font in the viewer is only used if the book you are vieweing has not specified any fonts of its own. The best way to ensure you get the fonts you want is to convert the book, embedding the font during conversion.
kovidgoyal is offline   Reply With Quote
Advert
Old 10-03-2017, 01:22 PM   #3
Dfaure
Enthusiast
Dfaure began at the beginning.
 
Posts: 31
Karma: 10
Join Date: Jan 2013
Device: Kobo Libra 2 & Aura HD, Cybook Muse
That's fair.

I just wanted to use the calibre viewer in the same way I could do with a physical e-book reader.

Thanks to the user stylesheet parameter I can specify my own fonts for the ebook rendering, but these should be registered in the hosting system.

How could I do that without being obliged to install fonts on each computer I could use?
Dfaure is offline   Reply With Quote
Old 10-03-2017, 04:49 PM   #4
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by Dfaure View Post
That's fair.

I just wanted to use the calibre viewer in the same way I could do with a physical e-book reader.

Thanks to the user stylesheet parameter I can specify my own fonts for the ebook rendering, but these should be registered in the hosting system.

How could I do that without being obliged to install fonts on each computer I could use?
Open the e-book viewer go to "preferences" then "User_stylesheet" then use the following code with your font.

Code:
body {
  font-family: "MyFont", serif;
}
@font-face {
  font-family : MyFont;
  font-weight : normal;
  font-style: normal;
  src : url(MyFont.otf);

@font-face {
  font-family : MyFontBold;
  font-weight : bold;
  font-style: normal;
  src : url(MyFontBold.otf);
}
@font-face {
  font-family : MyFontItalic;
  font-weight : normal;
  font-style: italic;
  src : url(MyFontItalic.otf);
}
@font-face {
  font-family : MyFontBoldItalic;
  font-weight : normal;
  font-style: BoldItalic;
  src : url(MyFontBoldItalic.otf);
}
Replace the Myfont... with the name and path of the font you are using.

example src : url(...\calibre\resources\fonts\MyFontBoldItalic.o tf)

Copy the font you would like to use into the font folder of the calibre portable.

That should work do not have a calibre portable to test.

bernie
gbm is offline   Reply With Quote
Old 11-02-2017, 05:28 AM   #5
Dfaure
Enthusiast
Dfaure began at the beginning.
 
Posts: 31
Karma: 10
Join Date: Jan 2013
Device: Kobo Libra 2 & Aura HD, Cybook Muse
Thumbs up Solution found

Well, I made some tests and even if took some time to report them here, once again, I found that Calibre is already handling this gracefully:

In the application settings folder, ie. either "Calibre Portable\Calibre Settings" on a portable instance or the equivalent one on regular installation ("%USERPROFILE%\AppData\Roaming\calibre"), just look for a "fonts" folder (or create one if needed).

Then, simply put your font files directly into it since sub-folder don't seem to be handled there, leading to something like:
Code:
Calibre Settings
 +-- fonts
      +-- my_font_a.ttf
      +-- my_font-Bold.ttf
      +-- my_font-BoldItalic.ttf
      +-- my_font-Italic.ttf
      +-- ...
At Calibre's e-book viewer start, the locally copied fonts are made available and may be selected in the Preferences/General/Font options like the system-wide default ones.
Dfaure is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom CSS Stylesheets for Calibre's Viewer Ralob Viewer 373 08-21-2023 03:24 PM
(Suggestion) Move ebook-viewer.exe to the main directory next to calibre-portable.exe avid01 Library Management 6 07-03-2014 03:55 AM
Calibre's ebook-viewer and embedded fonts in EPUB books gentoosiast Calibre 1 03-20-2013 07:53 AM
Touch Fonts question (special characters in stock and custom fonts) levil Kobo Reader 20 09-23-2011 01:51 PM


All times are GMT -4. The time now is 05:36 AM.


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