한글패치 관련 짧은 글들

XUnity.AutoTranslator rich text tags 사용하기

Snowyegret 2022. 2. 9. 03:15

원문: https://github.com/bbepis/XUnity.AutoTranslator/issues/260

 

유니티 게임을 AutoTranslator로 번역할 때, 태그가 붙어 나오는 것을 볼 수 있다.

대략 이런 식으로 나온다.

원래 <color="cyan"></color> or <color=#0fba3a></color>처럼 사용되어야 하지만

Autotranslator 특성상 "="가 원문/번역문의 구분자로 사용되므로 "=" 대신 "%3D"를 사용한다.

URL 인코딩하면 "="가 "%3D"로 변한다.

왜 <color%3D"cyan">이 아닌진 모르겠다. 암튼 저렇게 나오니까 똑같이 쓰면 된다.

 

수동 번역의 경우 MonoBehaviour 파일을 통해 전체적인 폰트 크기 제어가 가능하나,

자동 번역의 경우 대부분 Fallback/Override Font를 적용시키는 것으로 알고 있다.

그래서 수정하기 좀 껄끄러운 부분이 있는데, 이를 rich text tags를 통해 제어할 수 있다.

 

프레임워크 별로 어떤 태그가 사용되는지 보려면 각 링크를 클릭하면 된다.

 

UGUI: https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/StyledText.html

 

Rich Text | Unity UI | 1.0.0

Rich Text The text for UI elements and text meshes can incorporate multiple font styles and sizes. Rich text is supported both for the UI System and the legacy GUI system. The Text, GUIStyle, GUIText and TextMesh classes have a Rich Text setting which inst

docs.unity3d.com

 

TextMesh Pro (아마 기본으로 포함되기 이전 구버전): http://digitalnativestudios.com/textmeshpro/docs/rich-text/

 

Rich Text, TextMesh Pro Documentation

You can use rich text tags to alter the appearance and layout of your text. These tags work like HTML or XML tags, but have less strict syntax. A tag looks like . Many tags operate on a scope, which you can end with . Such scopes can be nested, and you don

digitalnativestudios.com

 

TextMesh Pro (신버전): https://docs.unity3d.com/Packages/com.unity.textmeshpro@4.0/manual/RichText.html

 

Rich Text | TextMeshPro | 4.0.0-pre.1

Rich Text Rich text tags alter the appearance and layout of text by supplementing or overriding TextMesh Pro GameObject properties. For example, you can use rich text tags to change the color or alignment of some, or all of your text without modifying its

docs.unity3d.com