Bitmap Font Importer 재임포트 시 폰트 매핑이 끊기는 문제
Unity Package: https://assetstore.unity.com/packages/tools/gui/bitmap-font-importer-62128#releases (Deprecated)
Asset store version has been deprecated. Please install from github.
GitHub: https://github.com/litefeel/Unity-BitmapFontImporter#install
비트맵 폰트나 이미지 폰트로 만든 폰트를 수정하면, 리임포트가 동작해도 .fontSetting 파일을 새로 만들지 못해 기존에 매핑된 폰트들이 missing되는 문제가 있었다.
v3.1.0 릴리스 노트를 근거로 이 문제가 고쳐졌다고 판단해, 쓰던 버전에서 업그레이드해 임포트했다(v2.4 → v3.3.0).
새 버전에서는 .fontSetting 파일을 만들 때 "Font Material" 문자열로 매핑하던 material.name에 폰트 이름을 직접 넣어, 머티리얼이 자동으로 매핑되도록 바뀌었다.
두 가지를 테스트했다.
- 로컬에서 폰트를 바꾼 뒤 푸시하고, 빌드 서버에서 받은 결과에서 폰트가 제대로 매핑되는지 확인 (문제 없음)
- 전체 폰트를 리임포트해 에러가 나거나 보이지 않는 폰트가 있는지 확인 (Assets → Bitmap Font → Rebuild Bitmap Font)
2번 과정에서 나온 문제는 다음과 같이 처리했다.
PercentNum_0: 폰트를 다시 생성해 해결NumPrice-export: 레거시 파일이라 삭제
- Edit → Preferences에서 Default Texture Type을 직접 지정할 수 있다(기본값은 GUI).
- 리임포트하면 특정 png의 meta 파일 Sprite Mode가 Single로 강제로 바뀌기 때문에 아래 코드는 주석 처리했다.
// Texture 설정을 변경하지 않도록 수정/*TextureImporter texImporter = AssetImporter.GetAtPath(texPath) as TextureImporter;texImporter.textureType = Settings.TextureImporterType;texImporter.mipmapEnabled = false;texImporter.wrapMode = TextureWrapMode.Clamp;texImporter.alphaIsTransparency = true;texImporter.alphaSource = TextureImporterAlphaSource.FromInput;
texImporter.streamingMipmaps = false;
// Spriteif (texImporter.textureType == TextureImporterType.Sprite) texImporter.spriteImportMode = SpriteImportMode.Single;
texImporter.SaveAndReimport();*/