Text to Display Rending
Here's the issue in the simplest terms I can explain it. This all started with subtitles. It is obviously easier to have a markup file with all the subtitle text in it instead of having to make individual graphics for each. Far as I know, this should be possible. Unfortunately, it's not going so well. After many attempts at subtitles, I decided to just add a very basic text output from the main markup file. It still did not work! I've checked the fonts, tried a few, and they are all Open Type. It's a very simple piece of code that just sets the position, font, and color. I left out all the timings and animations to be safe. Is there a bug in the Toshiba Players that won't do this or I am just overlooking something right in front of my face?
You should be able to do exactly what you're talking about using what's called Advanced Subtitles. Advanced Subtitles are basically an application minus JavaScript (Markup + Manifest + graphics + font). You will need a font to license to distribute on the disc. You can't just buy a single computer license for a font and use it on the disc.
I've tried many attempts with Advanced Subtitles. They were set in the Playlist as an Advanced Subtitle Segment and still no go. The subtitle markup file should be an XAS file correct? I've also tried it as an XMU file with no luck. The idea of displaying some basic text from the application markup is just to test the ability to render the text on-the-fly. The overall goal is to have it as an Advanced Subtitle.
Just out of curiousity, the player isn't looking for a licensed font and that could be the whole issue. This is currently just for developement. An actually live title would obviously have whatever licensing was needed.
Some common bugs:
Text cannot be positioned with x and y; you need to put it inside a <div> to position it
You probably need to give it a colour and a size
Fonts must be on the disc and referenced in the playlist, manifest, and markup file
Advanced Subtitles use inline timing (I think... don't have the spec handy) and so you would do eg:
<div begin="1s" dur="5s" style:x="0px" style:y="900px" style:height="100px" style:width="1920px">
<p style:font="file:///dvddisc/ADV_OBJ/myfont.ttf" style:fontSize="80px" style:color="white">Here is some subtitle text
</div>
I had no luck with the first reply. The formatting is very close to what I had been doing before. But on the other hand, the example from your blog works! It works when it is placed as an application markup. If I take the same idea and use the <input> command to display text in the Advanced Subtitles, it's doesn't work. Now I only had about a half hour to play before going home for the day, so tomorrow I will be right back at it. I will follow up with my findings.
Note that Advanced Subtitles have a limited set of things they allow -- it might be that <input> is not allowed. I'm pretty sure you can't have script or any indefinite timing in subtitles (everything must be time-based, which makes sense because you are synced to the movie). Try using
instead of <input>
I got it working. As per the spec, <input> is not supported in advanced subtitles and neither is inline styling. Though the sepc does not say it, it looks like the timing must be inline for it to work. In the end, it's a very simple file. I decided to post it below because I could not find a single reference on how to do so and others may be wondering how to. Here it is:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://www.dvdforum.org/2005/ihd" xmlns:state="http://www.dvdforum.org/2005/ihd#state" xmlns:style="http://www.dvdforum.org/2005/ihd#style" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dvdforum.org/2005/ihd
iHD.xsd" xml:lang="en-us">
<head>
<styling>
<style id="pos" style:position="absolute" style:x="0px" style:y="880px" style:height="100px" style:width="1920px"/>
<style id="font" style:font="font.ttf" style:color="#F6F6F6" style:fontSize="60px" style:height="100px" style:width="1920px" style:textAlign="center"/>
</styling>
</head>
<body>
<div style="pos">
<p begin="00:00:03:45" end="00:00:10:00" style="font">Subtitle 1
<p begin="00:00:11:45" end="00:00:13:00" style="font">Subtitle 2
<p begin="00:00:15:45" end="00:00:18:00" style="font">Subtitle 3
</div>
</body>
</root>
Only small problem left is alising. It's hard to read the white text during a bright scene. Anyone know if you can add multiple colors to the text to create an alising effect?
Have a <div> behind the main <div> that contains exactly the same content, but (i) is shifted down and to the right a couple of pixels, and (ii) has text colour of black. Then you get a fake drop-shadow.
Or use images and then you can do all sorts of Photoshop effects, etc.
I tried adding a second identical <div> underneath the original <div>, but it did not work. The player places it as if it were a new line below the first line. After that not working, I decided it would be easiest to use graphics for subtitles. The downside is the ACA file is growing. So far it hasn't been an issue, but I hope it does not become one once it is applied to a full length feature that has 3 or 4 different subtitle tracks. Seems like style:border attribute isn't working for subtitles. Had succes with a drop shadow but that really doesn't look nice. Only solution seems to be to use graphics to add a black border. You don't want your white subtitles to dissapear when they are on a white background.
Hi, Jeff Williams, did you get your posted example work with hdisim? I didin't. The SONIC-Simulator works well with your code.
Thanks for any advice
ds.
ds. at 2007-8-30 >

ds,
I never tried it with HDiSim. I am taking a guess that it might have to do with the URI of the font. Where I have
style:font="font.ttf"
try
style:font="file:///dvddisc/ADV_OBJ/font.ttf"
or something similar depending on your font name and folder structure.
Hi, Jeff Williams, thank you for your answer. The full-path declaration doesn't solve the problem. Maybe it's a bug in hdisim, because it runs on the thoshiba laptop as well as with SONIC.ds
ds. at 2007-8-30 >
