Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-06-2014, 03:00 PM   #1
Bilingual
Member
Bilingual began at the beginning.
 
Posts: 12
Karma: 10
Join Date: May 2013
Device: none
Question Any formatting options at all for the text in Kindle's instant dictionary popup?

I have been preparing an Icelandic dictionary with some success. I got the inflections working, which was my main issue. I did not use the tab2opf.py script, but instead used the boilerplate opf from the mobicon website together with an HTML-file created from a database of words with inflections and translations, I've compiled.

In order to increase usability, I would like to offer simultaneous translation to English in addition to my own language. To that end, I would prefer the output of the instant popup formatted somewhat like this:

dictionary-word
English translation
other translation

I have been tinkering with various HTML-codes, but they all seem to only apply to the full dictionary lookup and not to the instant popup, which always render:

dictionary-word English translation other translation

Now, do any text formatting options actually exist that applies to instant popup?


I have another small problem in that a few of my dictionary lookups adds a number of sequential dictionary entries to the same instant popup, despite no apparent formatting errors and no problems with the entries in the full dictionary lookup. Can't really grok that one.

Any pointers would be most welcome.
Bilingual is offline   Reply With Quote
Old 06-21-2014, 11:18 AM   #2
chipf0rk
Member
chipf0rk began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Nov 2013
Location: Germany
Device: Kindle Paperwhite (2nd gen)
Quote:
I have been tinkering with various HTML-codes, but they all seem to only apply to the full dictionary lookup and not to the instant popup, which always render:

dictionary-word English translation other translation

Now, do any text formatting options actually exist that applies to instant popup?
I'm not sure what device you are using. I have a Paperwhite 2nd generation, and tried fiddling with a sample dictionary (the HTML file) a bit now. What I found out is this:
  • <br> and <p> work fine to force line breaks inside one dictionary page. <br> is preferable, because it does not add an indent on the left.
  • You have to use <br>, not <br />. <br /> was heavily misinterpreted by my Kindle and broke the entire parent tag.
  • You can also define multiple pages for one definition, as seen in dictionaries delivered with the Kindle. Doing this manually is easy: Just copy the <idx:entry> tag and the preceding <mpb:pagebreak> tag, and change the content (everything after <h2>, not <idx:orth> and <idx:key>). This will show up as two separate entries in the "full dictionary".

Quote:
I have another small problem in that a few of my dictionary lookups adds a number of sequential dictionary entries to the same instant popup, despite no apparent formatting errors and no problems with the entries in the full dictionary lookup. Can't really grok that one.
If I understand "sequential dictionary entries" correctly, this might be related to my last point above: Maybe you erroneously have duplicate keys for the same word, which will show up separated as pages.

Other than that, I'd be really interested in having the Icelandic-English dictionary in its current state myself, or at least a pointer to the source for your database that includes inflections. I only have a rather bad is-en dictionary at the moment which is auto-generated from dict.cc data and does not support any inflections. I'd be incredibly thankful if you could share your work with me here, as I can't find anything like this anywhere online.

DISCLAIMER: This is based on the manual research of an hour, after not being able to find anything on more knowledgeable sources than myself. What I'm saying might not be 100% correct, but it didn't break anything for me.
chipf0rk is offline   Reply With Quote
Advert
Old 07-15-2024, 03:04 AM   #3
sricochet
Enthusiast
sricochet began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Sep 2014
Device: Kindle Scribe
For anyone who happens across this old post and is wondering the same, the font cannot be changed.

Phonetic letters are recognized, as well as italics and boldface aspects of fonts.

These features can be created using a dictfile (.df) and creating definitions with html code. This file can then be used as the input file in pyglossary or other scripts that use pyglossary to make a MOBI dictionary.


Instructions for creading a .df file can be found here:

https://pgaskin.net/dictutil/dictgen/#dictfile-format

When the Kindle updates, the font is often changed for the dictionary popups, however the font is updated later to the default font.
sricochet is offline   Reply With Quote
Old 07-15-2024, 03:05 AM   #4
sricochet
Enthusiast
sricochet began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Sep 2014
Device: Kindle Scribe
Edit: Adding support for fonts in the dictionary popups would be a great feature request.
sricochet is offline   Reply With Quote
Old 07-15-2024, 11:50 AM   #5
mergen3107
Wizard
mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.mergen3107 ought to be getting tired of karma fortunes by now.
 
mergen3107's Avatar
 
Posts: 1,323
Karma: 4740000
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
Dictionaries support css formatting.
You can try adding font-face to see what happens.

css instructions here: https://github.com/koreader/koreader...n-a-dictionary

Step 4
mergen3107 is offline   Reply With Quote
Advert
Old 07-16-2024, 03:02 AM   #6
sricochet
Enthusiast
sricochet began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Sep 2014
Device: Kindle Scribe
I tried css and the font weight and font style and font size changed, but the actual font remained the same standard font. perhaps I'm doing something wrong? I made a style.css file with font-face, then referred to the fonts with <font1>...</font1> etc.

I think that the font for the dictionary popup is a standard font, and the fonts in the Open Dictionary option are the standard fonts that Kindle comes with.

I guess the Kindle is not really that great for customizations. I can live with these fonts though, it's no big deal.
sricochet is offline   Reply With Quote
Old 07-16-2024, 05:59 PM   #7
sricochet
Enthusiast
sricochet began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Sep 2014
Device: Kindle Scribe
I can confirm that nothing can be done to change the font. External, inlne css makes no difference. The font cannot be changed, or I have no method to change it.
sricochet is offline   Reply With Quote
Reply

Tags
dictionary output, formatting


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle PW2 3G. Instant translation options over 3G? gthalas Amazon Kindle 6 12-28-2013 12:41 PM
Dictionary popup # of lines option? kaito Kindle Developer's Corner 2 07-07-2013 05:52 PM
Why does the Kindle app have so few formatting options? menevets Apple Devices 8 11-16-2012 04:51 PM
More lines in Dictionary popup window jswinden Amazon Kindle 6 09-29-2011 03:03 PM
dictionary: popup preview Lucas C. Amazon Kindle 8 06-09-2011 04:14 PM


All times are GMT -4. The time now is 12:40 PM.


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