remarkable_news icon indicating copy to clipboard operation
remarkable_news copied to clipboard

xkcd comic needs Hover text added.

Open Snowflake6 opened this issue 4 years ago • 3 comments

Getting the xkcd comic seems easy but is there a way to get the mouseover/hover text and adding it as a caption at the bottom of the screen?

Snowflake6 avatar Apr 21 '20 05:04 Snowflake6

Looks like that would require fetching the title attribute for the image HTML element, then rendering it in the whitespace below the fetched image.

siraben avatar Apr 22 '20 07:04 siraben

I started to write some text to the image... but the font glyphs I'm using are pretty small!

https://github.com/Evidlo/remarkable_news/compare/master...fringley:feature/text-label

To be more successful, I think we would need to load in a font file, and then I'm not sure how to have this building for both environments. Comments welcome.

adding a -text flag to the command will add in some static text. For me this is enough (as i just want to add my contact details)... but as the request mentions, it would also be nice to pull through the alt text with another xpath expression.

Perhaps someone can take this further, as I'm still a Go newb.

fringley avatar Dec 16 '20 01:12 fringley

I updated my branch with the XKCD font which has a CC licence for non-commercial use.

The install script copies this to the root / which I'm pretty sure is not the right place for this - but my knowledge of Go and the filesystem on the rM is limited - so am open to suggestions for a better method of this working in x86 and arm environments.

However, the font is a decent size now! And would nicely match the xkcd comic if the alt text (rather than a static string) is passed in.

fringley avatar Dec 17 '20 00:12 fringley

#37 solves this by adding titles, subtitles and configurable fonts. With the xkcd ttf file:

image

[Unit]
Description=XKCD

[Service]
ExecStart=/home/root/bin/renews \
    -output /usr/share/remarkable/suspended.png \
    -verbose \
    -cooldown 3600 \
    -url https://xkcd.com \
    -xpath '//div[@id="comic"]/img/@src' \
    -xpath-title '//div[@id="comic"]/img/@alt' \
    -xpath-subtitle '//div[@id="comic"]/img/@title' \
    -title-font-path '/home/root/xkcd.ttf' \
    -subtitle-font-path '/home/root/xkcd.ttf' \
    -mode center \
    -scale 1.75
Restart=always

[Install]
WantedBy=multi-user.target

hashworks avatar Dec 19 '23 13:12 hashworks

Thanks @hashworks

Evidlo avatar Jan 30 '24 23:01 Evidlo