Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: experimental/PdfViewer/generate_code.py

Issue 18117005: more work on pdf fonts, more to come (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « experimental/PdfViewer/autogen/pdfspec_autogen.py ('k') | experimental/PdfViewer/spec2def.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 2
3 import sys 3 import sys
4 4
5 import datatypes 5 import datatypes
6 from autogen.pdfspec_autogen import * 6 from autogen.pdfspec_autogen import *
7 7
8 knowTypes = { 8 knowTypes = {
9 '(any)': ['SkPdfObject*', 'ObjectFromDictionary', datatypes.CppNull(), 'true'], 9 '(any)': ['SkPdfObject*', 'ObjectFromDictionary', datatypes.CppNull(), 'true'],
10 '(undefined)': ['SkPdfObject*', 'ObjectFromDictionary', datatypes.CppNull(), 'tr ue'], 10 '(undefined)': ['SkPdfObject*', 'ObjectFromDictionary', datatypes.CppNull(), 'tr ue'],
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 self.fEnumValues = enumValues 55 self.fEnumValues = enumValues
56 return self 56 return self
57 57
58 def name(self, name): 58 def name(self, name):
59 self.fCppName = name 59 self.fCppName = name
60 return self 60 return self
61 61
62 def type(self, types): 62 def type(self, types):
63 # TODO (edisonn): if simple type, use it, otherwise set it to Dictionary, an d set a mask for valid types, like array or name 63 # TODO (edisonn): if simple type, use it, otherwise set it to Dictionary, an d set a mask for valid types, like array or name
64 types = types.strip() 64 types = types.strip()
65 types = types.replace('or', ' ') 65 types = types.replace(' or ', ' ')
66 types = types.replace(' or,', ' ')
67 types = types.replace(',or ', ' ')
68 types = types.replace(',or,', ' ')
66 types = types.replace(',', ' ') 69 types = types.replace(',', ' ')
67 types = types.replace('text', ' ') # TODO(edisonn): what is the difference b etween 'text string' and 'string'? 70 types = types.replace('text', ' ') # TODO(edisonn): what is the difference b etween 'text string' and 'string'?
68 types = types.replace('file specification', 'file_specification') 71 types = types.replace('file specification', 'file_specification')
69 72
70 73
71 self.fTypes = types 74 self.fTypes = types
72 return self 75 return self
73 76
74 def comment(self, comment): 77 def comment(self, comment):
75 self.fComment = comment 78 self.fComment = comment
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 620
618 fileHeaders.write('#endif // __DEFINED__SkPdfHeaders\n') 621 fileHeaders.write('#endif // __DEFINED__SkPdfHeaders\n')
619 fileHeaders.close() 622 fileHeaders.close()
620 fileHeadersCpp.close() 623 fileHeadersCpp.close()
621 624
622 return 1 625 return 1
623 626
624 if '__main__' == __name__: 627 if '__main__' == __name__:
625 sys.exit(generateCode()) 628 sys.exit(generateCode())
626 629
OLDNEW
« no previous file with comments | « experimental/PdfViewer/autogen/pdfspec_autogen.py ('k') | experimental/PdfViewer/spec2def.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698