johnoneil / arib

Japan Association of Radio Industries and Businesses (ARIB) MPEG2 Transport Stream Closed Caption Decoding Tools
Apache License 2.0
56 stars 9 forks source link

Font size and placement may not exactly match desired layout #19

Closed johnoneil closed 7 years ago

johnoneil commented 7 years ago

I just eyeballed a "good enough" font size support for an initial cut but i'd like to layout the screen text exactly as it is described in the .ts. This should be possible.

Primary symptoms in how current defects are seen are things like-- furigana not being properly aligned above the kanji they are meant to describe.

johnoneil commented 7 years ago

dragon ball super - 61 thk 1440x1080 mpeg2 aac - 00 07 25 601 -0001

johnoneil commented 7 years ago

dragon ball super - 61 thk 1440x1080 mpeg2 aac - 00 05 45 935 -0002

johnoneil commented 7 years ago

Correct placment of dialog (via mudansure.com) dragonballsuper61-16100912

johnoneil commented 7 years ago

generated by arib-ts2ass and rendered via mpv dragon ball super - 61 thk 1440x1080 mpeg2 aac - 00 06 07 423 -0001

johnoneil commented 7 years ago

With initial correction. much better! test- 00 06 08 791 -0001

johnoneil commented 7 years ago

for this example, original text position data is:

<clear screen><CS:"620;480 V"><CS:"170;30 _"><CS:"1;0000 c"><Small Text>
<Screen Posiiton to 10,14>ついせき
<Screen Posiiton to 12,5><Normal Text>これより<Medium Text> <Normal Text>追跡に入る<Medium Text>。
<Screen Posiiton to 6,13><Small Text>りょうかい<Medium Text>
<Screen Posiiton to 7,5><Normal Text><Medium Text>(<Normal Text>隊員<Medium Text>)<Normal Text>了解!
![dragon ball super - 31 thk 1440x1080 mpeg2 aac - 00 06 49 922 -0001]

dragon ball super - 31 thk 1440x1080 mpeg2 aac - 00 06 49 922 -0001

johnoneil commented 7 years ago

Analyzing the previous example. Proper X row for ついせき should be character 9 but it's listed as 14. Are we seeing the same wrapping in horizontal as in the vertical? Assuming the usual 36x36 characters and 4 pixel spacing between (not specified in the .ts stream for this file) and 620x480 text area (specified) the max # or characters horizontal will be 620/(40) or about 15 characters. That's 0 to 14 for columns and 0 to 7 for rows. Perhaps horizontal positions are specified with greater precision? So 14 maps to about column 9?

りょうかい should be at character 8 but is specified at character 13.

It's probably the small font. Positions for small text are probably specified differently. Maybe.

johnoneil commented 7 years ago
<clear screen><CS:"620;480 V"><CS:"170;30 _"><CS:"1;0000 c"><Medium Text>
<Screen Posiiton to 4,7><Small Text>たの<Medium Text>
<Screen Posiiton to 4,13><Small Text>つな<Medium Text>
<Screen Posiiton to 5,5><Normal Text><頼みの綱は<Medium Text> <Normal Text>この男>

たの should be at character 6 and it's at character 7 つな should be at character 9 and it's at 13

can only think we'll have to adjust horizontal position of small text

johnoneil commented 7 years ago

Looks like all our horizontal positions might be off by factor of 2.

col 5 --> col 2.5, furigana col 7 --> 3.5, the 2nd character. correct col 5 --> col 2.5, furigana col 13-->6.5 the 4th character, about correct

johnoneil commented 7 years ago

Better dragon ball super - 31 thk 1440x1080 mpeg2 aac - 00 06 49 521 -0001

johnoneil commented 7 years ago

images 6 2016 12 31 sp 1080i - 01 00 25 938 -0001

vertical alignment still off.

johnoneil commented 7 years ago

Screen Sizing and Placement Info for Various Files

gaki scientists (above):

aibou:

aijin:

johnoneil commented 7 years ago

screenshot from 2017-01-07 15-50-02

"7 S" code above indicates "horizontal writing form in 960 x 540" which makes sense. I've never seen another format used yet but this bears at least better logging.

johnoneil commented 7 years ago

screenshot from 2017-01-07 15-52-48

"8 n" above in Aijin file indicates "Raster Colour set" to "transparent" This doesn't make much sense and is probably ignored.

johnoneil commented 7 years ago

Closing this issue to reopen a new issue concerning just HORIZONTAL alignment.