浏览代码

LibPDF: Construct accented characters with Type1 seac command

The seac command provides the base and accented character that are
needed to create an accented character glyph. Storing these values is
all that was left to properly support these composed glyphs.
Rodrigo Tobar 2 年之前
父节点
当前提交
e4a7606b81
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      Userland/Libraries/LibPDF/Fonts/Type1FontProgram.cpp

+ 11 - 1
Userland/Libraries/LibPDF/Fonts/Type1FontProgram.cpp

@@ -397,11 +397,21 @@ PDFErrorOr<Type1FontProgram::Glyph> Type1FontProgram::parse_glyph(ReadonlyBytes
                 case DotSection:
                 case VStem3:
                 case HStem3:
-                case Seac:
                     // FIXME: Do something with these?
                     state.sp = 0;
                     break;
 
+                case Seac: {
+                    auto achar = pop();
+                    auto bchar = pop();
+                    auto ady = pop();
+                    auto adx = pop();
+                    // auto asb = pop();
+                    state.glyph.set_accented_character(AccentedCharacter { (u8)bchar, (u8)achar, adx, ady });
+                    state.sp = 0;
+                    break;
+                }
+
                 case Div: {
                     auto num2 = pop();
                     auto num1 = pop();