Commit 7e75e3a8 authored by Carsten Emde's avatar Carsten Emde
Browse files

Added option to specify font name for Graphviz

parent 9f2be485
......@@ -64,7 +64,7 @@ def notarget(filename, limitsearch):
def createoutput(outputdir, outputformat, machine_to_binary, linked_libraries,
filename_to_full_path, elf_to_exported_symbols,
elf_to_imported_symbols, symlink_to_target, targets, forcesymbols):
elf_to_imported_symbols, symlink_to_target, targets, forcesymbols, fontname):
'''Create an output file for each set of ELF files that belongs together'''
# create an output file for each architecture/operating system
......@@ -159,6 +159,10 @@ def createoutput(outputdir, outputformat, machine_to_binary, linked_libraries,
outputfileopen.write("<nodes>\n")
elif outputformat == 'gv':
outputfileopen.write("digraph " + os.path.basename(limitsearch[0]) + " {\n ratio=0.562;\n")
if fontname is not None:
outputfileopen.write(" graph [fontname=\"" + fontname + "\"];\n")
outputfileopen.write(" node [fontname=\"" + fontname + "\"];\n")
outputfileopen.write(" edge [fontname=\"" + fontname + "\"];\n")
seenfirst = False
......@@ -410,6 +414,10 @@ def main(argv):
dest="outputformat",
help="output format 'cypher', 'gexf', 'gv' or 'text', default 'gv'",
metavar="FORMAT")
parser.add_argument("-p", "--fontname", action="store",
dest="fontname",
help="name of the font to be used throughout the document ('gv' only)",
metavar="FONT")
parser.add_argument("-s", "--skipdirs", action="store",
dest="skipdirs",
help="exclude directories from being scanned", metavar="DIR")
......@@ -771,7 +779,7 @@ def main(argv):
createoutput(outputdir, outputformat, machine_to_binary, linked_libraries,
filename_to_full_path, elf_to_exported_symbols,
elf_to_imported_symbols, symlink_to_target,
args.targets, args.forcesymbols)
args.targets, args.forcesymbols, args.fontname)
if __name__ == "__main__":
main(sys.argv)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment