Giter Site home page Giter Site logo

Comments (12)

astiob avatar astiob commented on September 26, 2024

To render vertical Japanese in ASS, you must do the following:

  1. Specify a Japanese font that supports vertical writing.
  2. Prefix the font name with an @ symbol.
  3. Rotate the line by −90° around the 𝑧 axis.
  4. 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.

ch3ewb4cc4 avatar ch3ewb4cc4 commented on September 26, 2024

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?
4

from libass.

astiob avatar astiob commented on September 26, 2024

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.

rcombs avatar rcombs commented on September 26, 2024

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.

astiob avatar astiob commented on September 26, 2024

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.

rcombs avatar rcombs commented on September 26, 2024

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.

ch3ewb4cc4 avatar ch3ewb4cc4 commented on September 26, 2024

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.

TheOneric avatar TheOneric commented on September 26, 2024

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.

rcombs avatar rcombs commented on September 26, 2024

Some previous investigation that may be relevant: waddou/libass#95

from libass.

astiob avatar astiob commented on September 26, 2024

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.

rcombs avatar rcombs commented on September 26, 2024

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.

astiob avatar astiob commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.