--You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.To post to this group, send email to standar...@googlegroups.com.Visit this group at https://groups.google.com/group/standardebooks.To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/452be919-5678-43ba-b841-f7a393f2cd46%40googlegroups.com.For more options, visit https://groups.google.com/d/optout.
Related: Do we convert to outlines because we don't have a license to embed the fonts?
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/4e6f307c-8c90-4ddc-9935-c333121f9072%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To post to this group, send email to standar...@googlegroups.com.
Visit this group at https://groups.google.com/group/standardebooks.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/c25af504-a88c-4082-9f98-6bf1103f2f72%40googlegroups.com.
OK, looks like it does indeed work in iBooks! I've gone ahead and pushed an update to the tools repo which adds it to the compatibility CSS we include in our compatible epub.
I'm actually super happy about this because I always read in night mode and this problem has plagued me since day 1 :)
I think Kindle may have wishy-washy support for various media
queries but unfortunately Kindle is a junk platform, so chances
that the selector we need being equally supported across all of
their apps/devices is probably slim. But if you want to look in
to it, please feel free. Kindle gets its own compatibility CSS
file inserted during the build process, which is at
templates/kindle.css
--
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/189D4346-6B10-4CB8-80D0-8A6BC1943388%40reala.net.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/1b52c7c1-94f1-7bce-c53f-22ec901728b5%40standardebooks.org.
I just had a thought. If we can invert the colors of images, what about inverting colors for images within books where we know it's a black-and-white illustration? For example, see the floor plan in Mysterious Affair at Styles: https://github.com/standardebooks/agatha-christie_the-mysterious-affair-at-styles/blob/master/src/epub/text/chapter-3.xhtml
If we can mark images like that with a special class, then we could invert that too when night mode turns on...
Thoughts?
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/6b8957a0-1599-41e6-8ace-a52b0b17d362%40googlegroups.com.
Interesting idea. Right now I don't think there are semantics
for color depth in either the epub vocabulary or the z3998
vocabulary.
z3998 can differentiate between "illustration" and "photograph" but that's as far as it goes.
So maybe we need to add to the special se vocabulary for this stuff.
For color depth, we could add `se:color-depth.black-and-white`. If an image lacks that semantic then we assume it's in color.
Then, the CSS selector to invert images would select against images that are both `se:line-art` and `se:black-and-white`.
How does that sound?
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/c5f4602a-6da0-4e6f-9c18-e171e133ae29%40googlegroups.com.
Thanks Jiminy!
As I mentioned a little upthread, I think the best approach is one where epub authors use semantics to describe the content, and then reading systems style the content based on that description.
This switch to semantics-based development has been brewing in the general web for quite some time, and HTML5 and CSS give us all the tools we need to make it happen today. We should all keep in mind that HTML was originally designed to mark up documents for reading just like a book. That's why we've had elements like <h#> and <p> and <blockquote> since the stone age--the tools are already there.
So with that in mind, going back to night mode, I think the best
approach would be to leave night mode styling to the reading
system, just like we do today. Today, you can turn on night mode
and reading systems know to invert the text color and background
color, because that's how the document is laid out. They don't
invert text color because we included a (for example)
`class="night-mode-ok"` attribute on every <p> tag.
How could we add semantics to images that a smart reading system would understand as being able to be inverted for night mode? Well, just about the only kinds of images we would want to invert in the general case are black-on-transparent line-art images. (Note that you could have, for example, a monochrome green image, and inverting that would not be correct; and you can also have rich greyscale images, which we also would not want to invert.)
So obviously invertible images are things like images of text,
line art, maybe some subclass of etchings. We can mark those
images with `epub:type` semantics, like
`epub:type="black-on-transparent line-art"`. That would be an
explicit OK from the ebook author that those images are
invertible, and we add rich semantic information instead of saying
something unsemantic like `epub:type="invert-me-please"`.
SVGs are another great candidate, and I think it would be really
excellent if the reader knew how to invert them if their color was
set to `currentColor`. That would be an explicit OK from the
ebook author to allow the reading system to set a readable color
for the image. At the very minimum I think that would be one
almost unambiguous win.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/0fd39749-b7b0-4b54-8753-ed60fd89d1a3%40googlegroups.com.
That's pretty clever, I like that as a workaround until some kind of night mode standard gets finalized.
Let me play around with it and see.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/36b91d76-bbd8-4461-8b0b-5b99e91ca46a%40googlegroups.com.
OK, I've done a test build for some of these concepts. See the attached epubs (the compatible .epub in particular).
This build features a few things:
- In the pure source (.epub3):
- We've denoted invertible images with
`epub:type="se:color-depth.black-on-transparent"` as a signal to
ereaders to invert such images.
- SVGs no longer define a fill color, leaving it to the
default. For most systems this should just be #000, and an
ereader that supports SVG and is smart enough to change the
default fill/stroke color for the SVG when night mode turns on can
change it to #FFF. The hanging power cord in the SE logo is
defined using stroke, and that stroke is set to `currentColor`
which has spotty support in some SVG renderers. (Gnome image
viewer doesn't render it, but Firefox does for example.)
- In the compatible build (.epub):
- CSS is injected to target iBooks and use a filter to invert images with the type `se:color-depth.black-on-transparent`
- The titlepage SVG is given a 1px #FFF stroke before being
converted to SVG; so while it should invert fine in iBooks, other
ereaders will display a white border like Jared suggested.
- The logo SVG doesn't get that treatment because the power cord itself is rendered using stroke. (So we can't add a stroke to a stroke.) If anyone has suggestions on that front please let me know.
Can you guys open up the .epub file and take a look?
Specific things to review:
- Titlepage in day mode and night mode, in iBooks and a different reading system
- Chapter 4, which includes several invertible illustrations: day
and night mode in iBooks (CSS can't target other reading systems
at the moment and we can't add stroke to these kinds of scanned
JPG)
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/16f9831f-b2bc-4887-8535-5a155954cc6b%40googlegroups.com.
When you say logo SVG, do you mean the SE publisher logo on the imprint page? (the page after the titlepage)
That logo doesn't get a stroke, because as I mentioned the power cord is drawn using stroke so we can't stroke on top of stroke. So I just didn't put stroke on it at all. I'm not sure how to proceed here.
I see the white stroke on the titlepage with the gray bg, that's
unfortunately going to be unavoidable with the current method
where we convert all pngs to svgs for the compatible build. It's
going to be a tradeoff--ereaders that we can't target for night
mode get a readable white outline, at the expense of having the
white outline visible when using non-white bgs in the general
case.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/122e9e10-b7c9-4812-ae45-2c0a82c1b063%40googlegroups.com.
Jared that SVG is great, thanks! I've put those changes into the new logo so now we can add stroke to the whole thing.
I think it looks pretty good, with the minor complaint that in the upper portion of the laurels the stalk becomes invisible because the white stroke overwhelms the black fill. Does anyone have suggestions on how to solve that?
I've updated the test epub if you all want to take a look. Note
the logo on the imprint should now work in night mode using the
SVG white stroke method; and I've also tried giving the PNGs in
chapter 4 a transparent background. I like this for storing in
our "perfect epub" source, because that perfect reader should
invert these images; but I think in practice it would make them
unreadable on night mode in any reader besides iBooks.
Let me know how it looks. I think what we'll probably do is add a
step to the build process to swap transparent BG in PNGs for
white, when building the compatible epub.
--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To post to this group, send email to standar...@googlegroups.com.
Visit this group at https://groups.google.com/group/standardebooks.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/49cb3f7a-277b-46c6-bfc8-9b5f82d84638%40googlegroups.com.
Sure, here's the draft logo SVG I'm working on.
I did some research and `stroke-align` is just a draft property with zero support so far.
Give your method a shot and let's see what we can come up with.
Clean code is important even in the SVG I think.
The big problem is going to be automating it during the build
process. The SVG we keep in the repos should be the "perfect"
one, which means no stroke at all (on the assumption that the
"perfect ereader" will know to invert colors without further
prompting). Then we tweak it during build, and right now we have
it easy, because all we have to do is a simple string replace to
inject a `style="stroke: #fff"` attribute into every path in the
SVG and boom, we're done--instant white stroke applied in the
interest of broad ereader compatibility.
But now if we're talking about duplicating paths, positioning them and styling them differently, well that becomes way more complicated right away, maybe even too complicated to easily script. But no reason not to give it a shot if you think you can pull it off.
I'm not sure why the stroke on the logo seems thicker than the
stroke on the titlepage text, since both are just 1px white.
--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To post to this group, send email to standar...@googlegroups.com.
Visit this group at https://groups.google.com/group/standardebooks.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/e9484cfd-fec8-4bb3-8a4e-b1f265a3a4fc%40googlegroups.com.
You know what, never mind... I think I got it :)
I set up the build script to duplicate the paths in the SVG, add a 2px stroke for the logo and 4px stroke for the titlepage, and lay the duplicate under the original paths. This achieves the effect you're describing Jared. You're right, it does look much better. Simpler than I thought, too.
Attached is the new test epub using this method. This epub also
has transparent PNGs converted to white backgrounds, also part of
the build script. Give chapter 4 a quick look to confirm it's
working. (In night mode, images should be black-on-white in all
ereaders except ibooks, where they should be white on black thanks
to the targeted CSS)
--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To post to this group, send email to standar...@googlegroups.com.
Visit this group at https://groups.google.com/group/standardebooks.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/e9484cfd-fec8-4bb3-8a4e-b1f265a3a4fc%40googlegroups.com.
Ya know what, let me throw out another crazy experiment here.
Here's one more test epub file.
This one contains the stroke adjustments from the previous file I
sent.
But this one differs from the last one in this way:
- PNGs remain transparent
- Compatibility CSS is injected to target the <img> tag and give all such PNGs a CSS background-color of white. (This is perfectly valid CSS but it's questionable how well-supported it is in ereaders)
- iBooks is specifically targeted to reset the white background
to transparent.
The result should be:
- In iBooks, PNGs do not have a background color in the white/sepia/gray modes, and yet still are inverted in black/night mode
- In all other ereaders, PNGs have a solid white background at all times.
So the question is, does this actually work? Can someone test on iBooks and some other apps to see what the result is? (Chapter 4 is the chapter of interest here)
You can unzip the epub and inspect core.css (at the bottom) to see exactly what I'm talking about in more detail.
I'm not sure how well the general ereader supports background
colors on <img> tags, and I'm also not sure if I targeted
iBooks correctly.
--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To post to this group, send email to standar...@googlegroups.com.
Visit this group at https://groups.google.com/group/standardebooks.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/e9484cfd-fec8-4bb3-8a4e-b1f265a3a4fc%40googlegroups.com.
Oops, I screwed up the styling a little in the last example.
This should be the correct one, attached, that is experimenting
with transparent PNGs in night mode / outside stroke on SVGs.
--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To post to this group, send email to standar...@googlegroups.com.
Visit this group at https://groups.google.com/group/standardebooks.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/e9484cfd-fec8-4bb3-8a4e-b1f265a3a4fc%40googlegroups.com.
<a href="https://idpf.github.io/epub-guides/aria-mapping/" rel="nofollow" target="_blank" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fidpf.github.io%2Fepub-guides%2Faria-mapping%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEBm2UBCyHP6Rn88VMELuvfio7uzw';return
Yeah I see what you mean. I used Gimp's "color to alpha"
function so maybe it didn't do a great job with making the white
BG totally transparent. I'm open to suggestions on how to fix
this too. (You can access the originals in the Styles repo, I
haven't pushed the transparent PNGs yet)
--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To post to this group, send email to standar...@googlegroups.com.
Visit this group at https://groups.google.com/group/standardebooks.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/494d9770-31f6-4f29-806b-9bea6753e6bf%40googlegroups.com.
OK, looks like the BG for these isn't #ffffff, it's #fcfdfc which looks just about the same but I didn't use the dropper to inspect. So when I did "color to alpha" I selected #ffffff and it left the remainder of the blend as a very faint shadow. My fault.
I've updated them with the correct colors set to transparent, hopefully it's improvement... attached
If things look good then I want to test a little more to ensure
background colors work in most other ereaders, then we can
solidify this standard and apply it to our previous ebooks
--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To post to this group, send email to standar...@googlegroups.com.
Visit this group at https://groups.google.com/group/standardebooks.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/e2f4832a-e0fc-4bfe-bc2e-39e862a6e594%40googlegroups.com.
Alright I'm kicking off a build on our ebook library to rebuild
everything with the new titlepages/logos. Sadly I think Styles is
the only book that will benefit from the transparent PNG technique
but at least we got it sorted for future use.
--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To post to this group, send email to standar...@googlegroups.com.
Visit this group at https://groups.google.com/group/standardebooks.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/4e967e3c-735a-4beb-adc3-511f280c9db4%40googlegroups.com.