|
First of all, you never mentioned the atmega in that post. I just looked at the link you gave me. I didn't miss a sentence. What was being discussed was the Arduino framework. It is only incidently related to an atmega in that an atmega will run it. It's not the only thing that does.
Member 13301679 wrote: That's what "not completely realisable" means.
It's what this means
Member 13301679 wrote: Maybe you should tell your client that the project they contracted you for is not completely realisable
I bolded the relevant bits. You forgot the operative part. I was never contracted to build a 100% to spec e-reader.
Real programmers use butterflies
|
|
|
|
|
Quote: First of all, you never mentioned the atmega in that post. I just looked at the link you gave me. I didn't miss a sentence. What was being discussed was the Arduino framework. It is only incidently related to an atmega in that an atmega will run it. It's not the only thing that does.
Okay, what do you see as the second sentence in
[^]?
Quote:
Member 13301679 wrote:
That's what "not completely realisable" means.
It's what this means
Member 13301679 wrote:
Maybe you should tell your client that the project they contracted you for is not completely realisable
I bolded the relevant bits. You forgot the operative part. I was never contracted to build a 100% to spec e-reader.
The operative part being that you don't do this for money? It's damn funny then that you lecture some who does get paid for embedded stuff you are trying to learn
Anyway, back to the topic, you bolded the part where I said it's not compeletely realisable, and then you said you can do most of it, mostly.
Sounds like you agree but can't bring yourself to admit it. No as much as I like to see people whine that "I can't see the word atmega in a paragraph of two sentences" when given a direct link, I cannot entertain your self-humiliation much longer - as a professional I have paying clients to attend to. You'd do the same once you start getting paid for your "work".
|
|
|
|
|
I like that you think I'm trying to learn. I get paid to write embedded. I'm done with you. I have no patience for hubris.
Real programmers use butterflies
|
|
|
|
|
Honey, ascenders and descenders are letters like 't', 'l', 'h' that ascend above a standard 'a' type character and descenders are 'p', 'q', 'y' that descend below a standard 'a' type character.
|
|
|
|
|
Oh I thought it was going to be something weird.
Yeah my stuff does that. It's basic truetype. you couldn't render fonts without it.
Real programmers use butterflies
|
|
|
|
|
Jargon is always scary until you know what it means!
|
|
|
|
|
There is a pre baked library that covers many of these problems:
http://site.icu-project.org/
Do not underestimate the weedy-ness of wrapping text. Check out some of the South Asian scripts. Thai, for example, has no spaces.
Another strategy would be to scroll the too-long word. Think 1980's 16 character LED and LCD displays.
|
|
|
|
|
Fixed width fonts, know how many across, break there.
Is that an option?
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
|
|
|
|
|
Not really. The whole thing is open type/true type and using digital typesetting. Worse, there are default fonts but they can be overridden by the EPUB via CSS.
And really the problem is knowing where I should break the word. I could do it right in the middle but that seems less than good.
Real programmers use butterflies
|
|
|
|
|
As you are already neck-deep into CSS you should learn from it...
word-break: break-all;
To prevent overflow, word breaks should be inserted between any two characters (excluding Chinese/Japanese/Korean text).
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
|
|
|
|
|
honey the codewitch wrote: In the real world, I'd just find a syllable and then hyphenate
What about hyphenating at random places ? How often do you need it ?
|
|
|
|
|
I'm not sure. It depends on the size of the screen that's connected to the e-reader I'm making. It can use any size screen, though in the end I'll be settling on a 600x800 epaper display
Real programmers use butterflies
|
|
|
|
|
The browser rendering engine already has good support for splitting words.
I put "hypens: auto;" into my CSS and I am quite pleased with the result.
[edit]: My css is as follows (lookup the hyphenate styles for what they do)
body {
font-family: 'Computer Modern Serif';
margin: 40px auto;
max-width: 640px;
line-height: 1.6;
font-size: 16px;
padding: 0 10px;
hyphens: auto;
hyphenate-limit-lines: 2;
hyphenate-limit-chars: 6 3 2;
text-indent: 30px;
}
|
|
|
|
|
Wouldn't that be great if I didn't have to implement my own web browser which is the whole point of this?
Real programmers use butterflies
|
|
|
|
|
Quote: Wouldn't that be great if I didn't have to implement my own web browser which is the whole point of this?
Well, your initial message didn't specify that as a point and my crystal ball isn't working today
But, isn't it great that I gave you a really nice introduction into the complexities of your problem over here:
The Lounge[^]?
|
|
|
|
|
I also didn't say I was using a web browser. It's weird that you would assume I was. C# is the most commonly used language at CP, not HTML and CSS.
Real programmers use butterflies
|
|
|
|
|
CSS schould do the trick automatically, see https://medium.com/clear-left-thinking/all-you-need-to-know-about-hyphenation-in-css-2baee2d89179
|
|
|
|
|
Oh, so you're volunteering to write the CSS engine for me right?
Real programmers use butterflies
|
|
|
|
|
Totally - since CSS engines are my bread and butter...
not really, I just thought EPUB displays content using something that is capable of CSS...
|
|
|
|
|
Yes, it does. I wish it didn't. I'm making an epub reader on a device that can't even run a basic web browser.
Real programmers use butterflies
|
|
|
|
|
Do you know https://github.com/litehtml/litehtml ? this not a browser but just a parser for html and CSS... perhaps this can help...
|
|
|
|
|
I've got a parser, and that uses the STL and I cannot rely on the STL being available.
Real programmers use butterflies
|
|
|
|
|
Scrollbars!
|
|
|
|
|
How much (ROM,RAM) space do you have? Could a translation of a library like this into C++ be of any use? The core hyphenation engine is 24kB of WASM, which would probably translate into a similar amount of assembly...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I might be able to translate it, but 24kB is significant. I have about 300kB of usable general purpose RAM, 4MB of NVS flash, and *sometimes* 4MB of PSRAM
Basically how I've orchestrated this it works in 300kB but works much faster if you have the PSRAM as well.
The 4MB of NVS storage is divvied up between my code and a data partition I use to store unpacked EPUB content. I'm not sure offhand how much program space I have.
The bad part of using more program space is it starts to make the dev cycle turnaround longer because you have to upload the code via serial uart.
Real programmers use butterflies
|
|
|
|