|
99 | 99 | import sys |
100 | 100 |
|
101 | 101 |
|
102 | | -VERSION = '0.8.2' |
| 102 | +VERSION = '0.8.3' |
103 | 103 | DEFAULT_GITCMD = 'git log --format="|Record:|%h|%p|%d|%ci%n%b"' # --gitcmd |
104 | 104 | DEFAULT_RANGE = '--all --topo-order' # --range |
105 | 105 |
|
@@ -704,6 +704,10 @@ def gendot(opts): |
704 | 704 |
|
705 | 705 | ofp.write('digraph G {\n') |
706 | 706 | for v in opts.dot_option: |
| 707 | + if len(opts.font_size) and 'fontsize=' in v: |
| 708 | + v = re.sub(r'(fontsize=)[^,]+,', r'\1"' + opts.font_size + r'",' , v) |
| 709 | + if len(opts.font_name) and 'fontsize=' in v: |
| 710 | + v = re.sub(r'(fontsize=[^,]+),', r'\1, fontname="' + opts.font_name + r'",', v) |
707 | 711 | ofp.write(' {}'.format(v)) |
708 | 712 | if v[-1] != ';': |
709 | 713 | ofp.write(';') |
@@ -1043,6 +1047,10 @@ def gettext(s): |
1043 | 1047 | origin/1.0.0, origin/1.0.1 and origin/1.1.0 |
1044 | 1048 | $ {0} --choose-branch origin/1.0.0 --choose-branch origin/1.0.1 --choose-branch origin/1.1.0 git01.dot |
1045 | 1049 |
|
| 1050 | + # Example 11. change the font name and size for the graph, nodes |
| 1051 | + # and edges. |
| 1052 | + $ {0} --png --font-name helvetica --font-size 14.0 git.dot |
| 1053 | +
|
1046 | 1054 | COPYRIGHT: |
1047 | 1055 | Copyright (c) 2017 Joe Linoff, all rights reserved |
1048 | 1056 |
|
@@ -1193,7 +1201,7 @@ def gettext(s): |
1193 | 1201 | nodes by dot in large graphs. |
1194 | 1202 | ''') |
1195 | 1203 |
|
1196 | | - x = ['graph[rankdir="LR", bgcolor="white"]', |
| 1204 | + x = ['graph[rankdir="LR", fontsize=10.0, bgcolor="white"]', |
1197 | 1205 | 'node[shape=ellipse, fontsize=10.0, style="filled"]', |
1198 | 1206 | 'edge[weight=2, penwidth=1.0, fontsize=10.0, arrowtail="open", dir="back"]'] |
1199 | 1207 | parser.add_argument('-d', '--dot-option', |
@@ -1245,6 +1253,22 @@ def gettext(s): |
1245 | 1253 | contains @FOO which is probably not what you want. |
1246 | 1254 | '''.replace('%', '%%')) |
1247 | 1255 |
|
| 1256 | + parser.add_argument('--font-name', |
| 1257 | + action='store', |
| 1258 | + type=str, |
| 1259 | + default='', |
| 1260 | + help='''Change the font name of graph, node and edge objects. |
| 1261 | +Here is an example: --font-name helvetica. |
| 1262 | + ''') |
| 1263 | + |
| 1264 | + parser.add_argument('--font-size', |
| 1265 | + action='store', |
| 1266 | + type=str, |
| 1267 | + default='', |
| 1268 | + help='''Change the font size of graph, node and edge objects. |
| 1269 | +Here is an example: --font-size 14.0. |
| 1270 | + ''') |
| 1271 | + |
1248 | 1272 | parser.add_argument('-g', '--gitcmd', |
1249 | 1273 | action='store', |
1250 | 1274 | type=str, |
|
0 commit comments