Browse Source

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 years ago
parent
commit
e4a7606b81
1 changed files with 11 additions and 1 deletions
  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 DotSection:
                 case VStem3:
                 case VStem3:
                 case HStem3:
                 case HStem3:
-                case Seac:
                     // FIXME: Do something with these?
                     // FIXME: Do something with these?
                     state.sp = 0;
                     state.sp = 0;
                     break;
                     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: {
                 case Div: {
                     auto num2 = pop();
                     auto num2 = pop();
                     auto num1 = pop();
                     auto num1 = pop();