Comments (12)
To render vertical Japanese in ASS, you must do the following:
- Specify a Japanese font that supports vertical writing.
- Prefix the font name with an
@
symbol. - Rotate the line by −90° around the 𝑧 axis.
- Most likely, reposition the line on screen by hand, because the default positioning may be wrong and cause part of the text to get cut off.
You can specify the font and rotation using override tags:
Dialogue: 0,0:00:00.00,0:00:10.00,Default,,0,0,0,,{\fn@Meiryo\frz-90}日本語もいい
or in a style definition:
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: VerticalJapanese,@Meiryo,96,&H000000FF,&H000000FF,&H000000FF,&H000000FF,0,0,0,0,100,100,0,-90,1,0,0,3,0,196,0,1
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.00,0:00:10.00,VerticalJapanese,,0,0,0,,日本語もいい
For positioning, try changing the Alignment
(or the \an
override tag), MarginL
/MarginR
and either changing MarginV
or adding a \pos(X,Y)
override tag that sets explicit coordinates for the alignment point.
from libass.
Thanks for the reply. I did as you advised. The symbols are displayed horizontally; in illustrator they are displayed correctly. Do you know of a solution to this?
from libass.
I’m not sure which exact symbols you’re trying to use, but yes, some are unfortunately rotated incorrectly in current libass, and I’m afraid you don’t have any solution for this (other than manually positioning every glyph). You may get a better result using a Windows computer with VSFilter (instead of libass): for example, you could invoke VSFilter via AviSynth and use the AviSynth script as the input for FFmpeg.
This has previously been mentioned in #600 and https://code.google.com/archive/p/libass/issues/95 (and elsewhere), but we don’t seem to have a clearly dedicated GitHub issue for it. Maybe I should create one. My most recent idea was to have libass use HarfBuzz’s vertical-writing mode and hope that it solves this.
from libass.
Yeah, if VSFilter/GDI handles this, I would assume it's by using vertical mode for @ fonts, and setting that in harfbuzz should be exactly what we want here.
from libass.
The reason I have doubts is because vertical writing support in Windows is pretty old and I couldn’t find clear information on how fonts define it when I first tried (including by looking inside Microsoft’s older fonts). But yeah, it’s my best guess/hope that HarfBuzz should be able to handle it.
from libass.
Well, the core of it's going to be alternate glyphs using an opentype feature or the like, right? So at worst, we might have to experiment with specific flags (vert/vrtr/vrt2).
from libass.
Thank you for your advice.I have looked into Harfbuzz and it seems very difficult for me.But I'll try a little harder.
from libass.
Apparently there exists a libass downstream fork for displaying ISDB subtitles and one of its patches seems related to this and may be worth a closer look (at first glance it appears to also automatically rotate, which we don't want): 0p1pp1/libass@ca5cc11e1 + 0p1pp1@76704b5
@ch3ewb4cc4 if you’re only burning the subtitles into the video and not distributing the soft subtitles, you may want to use this fork until we have a proper, VSFilter-comaptible fix. (If you do distribute soft subs, do not use the downstream fork as whatever you author will be incompatible with any ASS real renderer, including both current and future fixed libass)
However, this fork breaks ABI (inserts a new element in the middle of the ASS_Style
struct) so you will also need to relink the programs using libass against the fork.
from libass.
Some previous investigation that may be relevant: waddou/libass#95
from libass.
Oh, someone did archive the Google Code repo on GitHub! That’s good to know. Of course, Google still hosts its own archive, but it’s anonymized.
from libass.
I can't reproduce the issue described here using the text て・ストー
with \fn@MS Mincho\frz-90
. Are we sure that this is still an issue? Could it be a case of outdated libass? Or maybe it happens in some fonts, but not others?
Please confirm what libass version you're using, and attach a sample ASS file and all associated fonts.
from libass.
I don’t think that’s ー
in the picture: it’s too long. (Of course, it’s not MS Mincho, either.) Certainly, an exact text sample would help for reproduction purposes.
from libass.
Related Issues (20)
- Font size differs from VSFilter for specific fonts HOT 4
- Try to parse script properties even if missing "[Script Info]" HOT 1
- Significant perf drop for specific, lower(!) resolution HOT 2
- Rendering: Unable to render some bitmap style fonts HOT 2
- Rendering: unexpected stretching HOT 3
- Rendering: libass doesn't set a default name for the style when it is empty HOT 1
- How to handle auto wrap when burn chinese subtitle with ffmpeg HOT 1
- Rendering: The same Ass script using the \blur tag performs abnormally on the Android platform, but on iOS HOT 1
- Rendering: Drawing without m isn't rendered by VSFilter HOT 2
- Why is the macro definition 'PARSE_START if (0)' executed HOT 1
- image question HOT 4
- A subset font has ligatures applied in VSFilter even without complex scripts HOT 1
- Some questions about ASS File Format Guide HOT 7
- Rendering: English glyph for Segoe UI Variable Display is wrong from yesterday HOT 2
- \ko fails to remove outline from shadow HOT 3
- Rendering: performance issue while rendering running rainbow animated subtitles HOT 4
- Rendering: Wrong font used for mpv OSD on Fedora 39+ HOT 2
- Multiple \pos tags in one line, any way to use them? HOT 2
- Inline fallback fonts should be sized to main font’s EM height, not line height
- How to blend ASS_Image to a rgba bitmap HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libass.