FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
vec/plottext.c at main · anachrocomputer/vec · GitHub
anachrocomputer
/
vec
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
27
Code
Issues
3
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
vec
/
plottext.c
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (26 loc) · 909 Bytes
Breadcrumbs
vec
/
plottext.c
Copy path
File metadata and controls
35 lines (26 loc) · 909 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* plottext --- plot a text string as wide as it will go 2012-09-09 */
/* Copyright (c) 2012 John Honniball */
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
"turtle.h"
#define
MAXX
(15970.0)
int
main
(
int
argc
,
char
*
const
argv
[])
{
int
len
;
const
double
width
=
MAXX
/
40.0
;
/* Width of plotter, in mm */
double
effchars
;
/* Effective chars, allowing for spacing */
double
size
;
/* Text size (height) required, in mm */
if
(
argc
<
2
) {
fputs
(
"Usage: plottext <string>\n"
,
stderr
);
exit
(
1
);
}
len
=
strlen
(
argv
[
1
]);
effchars
=
((
double
)
len
)
+
0.25
;
effchars
*=
1.5
;
/* Char cell 1.5 times actual char width */
size
=
(
width
/
effchars
)
*
1.31579
;
turtle
(
DEV_HPGL
,
SIZ_A3
,
ORI_LAND
,
FLG_NONE
);
title
(
argv
[
1
],
size
,
MID
|
CENTRE
,
FLG_NONE
);
show
();
return
(
0
);
}
Back
|
FazBrowse Home
|
New Git URL