 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 4/3/23 08:33, William F Pokorny wrote:
> Bald Eagle asked me if I'd dug into this issue. I'd not - though I had
> some guesses as to what might be wrong.
One of those guesses was that the marks were all present, but not
correctly placed. Meaning they were getting cut off by the automatic
bounding for each character.
Attached is a render turning off all automatic bounding(a) in the povr
fork with -mb - which confirms this is indeed happening.
Bill P.
(a) - The -mb option here fully works only in povr where the v3.6 and
prior '-mb' behavior was restored.
You can use -mb in official v3.7, v3.8 and v4.0 releases, but it no
longer turns off the very last level of bounding around an object.
Post a reply to this message
Attachments:
Download 'accentedvowels_bndsoff.png' (39 KB)
Preview of image 'accentedvowels_bndsoff.png'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 4/3/23 21:51, William F Pokorny wrote:
> Attached is a render turning off all automatic bounding(a) in the povr
> fork with -mb - which confirms this is indeed happening.
Update. Found and fixed two issues in the povr fork.
The first accounted for most of the problems where characters were made
up of multiple sub-glyphs. It goes as far back as I checked - to v3.0
source.
It's been the case that x & y offsets for the sub-glyphs, when of
non-word (aka byte) size, have been read as uint_8 and not int8_t
(signed char).
The unsigned values are used with a point offset method not supported in
our code at all. The x & y int8_t (signed char) method is - and it's
what all font's I checked use. The sometimes correct - and sometimes
completely wild results - come more from not handling he twos complement
representation correctly for the read values than having read bad values.
The second issue hits here and there and it is bounding. The bounding
was sometimes too tight for the resulting, flattened point loop
representation of the font.
I don't see a hard problem, say in not looking at all the points or
something. I believe, rather it's that the curve sometimes bulges
outside the least enclosing rectangles of point lists representing the
contours making up the character.
I sized up the bounding x,y size a little and fixed all but the edge of
one case. That one case looks to me like it needs 'too much' expansion.
Leaving it to look at in more detail later.
There is one definite issue is that the umlaut accented characters are
not rendered correctly in the FreeSerif.ttf font. No idea what is going
on there - those characters look OK to me for that font in other utilities.
Test images attached.
Bill P.
Post a reply to this message
Attachments:
Download 'povrfontfixes.png' (265 KB)
Preview of image 'povrfontfixes.png'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
William F Pokorny <ano### [at] anonymous org> wrote:
> The unsigned values are used with a point offset method not supported in
> our code at all. The x & y int8_t (signed char) method is - and it's
> what all font's I checked use. The sometimes correct - and sometimes
> completely wild results - come more from not handling he twos complement
> representation correctly for the read values than having read bad values.
Nice catch. That certainly accounts for the wild placement, whereas bounding
was just an incidental problem.
Now that you've stuck your head deep into the glyph-handling code, how difficult
would you say it would be to write code in SDL that would take a font file and
create splines and/or prisms?
Or make the internal conversion exposed to SDL so that the result could be
written to a file?
Nice work :)
- BW
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 4/5/23 06:34, Bald Eagle wrote:
> Now that you've stuck your head deep into the glyph-handling code, how difficult
> would you say it would be to write code in SDL that would take a font file and
> create splines and/or prisms?
That is what text{} does - more or less. You just don't see the result
is a union of a bunch of prisms (one per character) - where 'nested'
splines making up a character have been flattened.
>
> Or make the internal conversion exposed to SDL so that the result could be
> written to a file?
I thought about capturing the result too, and as a complete code hack,
not too bad to do.
Really supporting such a thing in SDL, much harder for sure. I doubt
worth it, but not thought much about performance differences, for example.
There are a large number of font tools out there which can do things
like dump particular glyphs. It's probably not too hard to create
something base on one of those too utilities too.
>
> Nice work 😄
Thanks.
Oh, I sorted that FreeSerif.ttf umlaut issue - 'twas me having left some
hacked code in place.
I've been playing with other fonts and symbols as a way to test a bit
more. Looking good thus. You do realize somewhat quickly there are
gazillions of free-ish fonts out there, but most cover only a small
number of Unicode character space. Anyhow. Attached another example
image - of some symbols this time.
One thing not working (and not expected to) is anything outside the
Basic Multilingual Plane (BMP). I pushed there a little - and it's all
crash, boom, bang at the moment.
Bill P.
Post a reply to this message
Attachments:
Download 'miscsymbols3.png' (308 KB)
Preview of image 'miscsymbols3.png'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2023-04-05 04:38 (-4), William F Pokorny wrote:
> On 4/3/23 21:51, William F Pokorny wrote:
>> Attached is a render turning off all automatic bounding(a) in the povr
>> fork with -mb - which confirms this is indeed happening.
>
> Update. Found and fixed two issues in the povr fork.
Any chance of pulling these changes into POV-Ray 3.8?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
William F Pokorny <ano### [at] anonymous org> wrote:
> On 4/5/23 06:34, Bald Eagle wrote:
> > Now that you've stuck your head deep into the glyph-handling code, how difficult
> > would you say it would be to write code in SDL that would take a font file and
> > create splines and/or prisms?
>
> That is what text{} does - more or less. You just don't see the result
> is a union of a bunch of prisms (one per character) - where 'nested'
> splines making up a character have been flattened.
>
> >
> > Or make the internal conversion exposed to SDL so that the result could be
> > written to a file?
>
> I thought about capturing the result too, and as a complete code hack,
> not too bad to do.
>
> Really supporting such a thing in SDL, much harder for sure. I doubt
> worth it, but not thought much about performance differences, for example.
I was sort of thinking about this as an infrequently used tool to export the
splines/prisms to an include file.
Currently, Cousin Ricky and I have resorted to using spreadsheets to convert
font files to splines. If the extant source code could be easily "fixed" to
remove any C/C++ tricky coding stuff, then I'm sure the rest of us could take it
from there and convert the rest of the C/C++ syntax to SDL to make a nice
include file that could take a font filename as an argument and write out a
series of objects as splines and prisms.
I also look at things like that as a great instructional/learning tool for
people to understand how things happen under the hood, and maybe enough dots get
connected where we have people want to step up to do development work.
(Also, IIRC, since the STL file format is virtually a clone of POV-Ray's
mesh/triangle syntax, it would be fantastic if that geometry could be read from
the file directly without conversion. Even if it were an experimental feature
that didn't do everything perfectly, it would still be a start, and a handy tool
for importing those kinds of meshes into scenes.)
- BW
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 4/6/23 14:17, Cousin Ricky wrote:
> On 2023-04-05 04:38 (-4), William F Pokorny wrote:
>> On 4/3/23 21:51, William F Pokorny wrote:
>>> Attached is a render turning off all automatic bounding(a) in the povr
>>> fork with -mb - which confirms this is indeed happening.
>>
>> Update. Found and fixed two issues in the povr fork.
>
> Any chance of pulling these changes into POV-Ray 3.8?
>
In this case I think my code changes could be pulled directly into the
v3.8 code base, but it's not something I tried or tested.
See:
http://news.povray.org/povray.beta-test/message/%3C642f33e8%241%40news.povray.org%3E/
or
Message: <642f33e8$1@news.povray.org>
Bill P.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |