lehmi commented on PR #171: URL: https://github.com/apache/pdfbox/pull/171#issuecomment-1818364479
The parser is based in the lexer/parser principle. The lexer knows the lexical structure of the format and the parser itself uses the lexer to read an interpret the content of the files using the format. The Type1Font is the result of the parsing and doesn't need to know anything about the file format itself. According to that principle the moved methods end up in the wrong class. If we really want to change something, we might merge the lexer and the parser class, but in the moment I don't see any real reason to do so. The implementation of readFontAttributes is, no offense, a no go. It is a wrapper for accessing the member values of the class. The huge switch statement would trigger our sonar scanner. A better approach is to introduce a setter for each value or an ever better solution is to introduce an additional class wrapping a couple of values which belong together, e.g. FontDirectory and FontInfo. Those classes could be used to initialize the Type1Font. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
