Skip to content

USER.CM location for .bravo files #2144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
masinter opened this issue May 9, 2025 · 6 comments
Open

USER.CM location for .bravo files #2144

masinter opened this issue May 9, 2025 · 6 comments

Comments

@masinter
Copy link
Member

masinter commented May 9, 2025

make sure the USER.CM location is at least as good as the one in @pmcjones 's bravo converter in finding an appropriate user.cm for .bravo files in the CHM PARC Archives files. I will raise reviewing that in a separate issue.

Originally posted by @masinter in #2119 (comment)

@rmkaplan
Copy link
Contributor

rmkaplan commented May 9, 2025

What is @pmcjones strategy? If not specified as a property in the OPENTEXTSTREAM/TEDIT calll, this looks for a USER.CM in the directory of the bravo file, if not there searches for USER.CM in the user's DIRECTORIES, if not there, asks in the promptwindow.

@pmcjones
Copy link

pmcjones commented May 9, 2025

My strategy was inferior: I hardwired fonts loosely based on the standard non-programmer's disk.

@rmkaplan
Copy link
Contributor

It would be simple to include a default set of paragraph and font properties when the USER.CM file for a given bravo file is unknown or can't be found. Just a Lisp variable initialized to a simple alist.

For example, here are two candidates, one parsed from the user.manual file that comes with the 3-Lisp files and the other is the user.cm that we used for the IDL files. They appear to differ only in the font assignments. Is there another one that would be a better default?

((ParagraphLeading 12)
(LineLeading 6)
(FirstLineLeftMargin 84)
(LeftMargin 84)
(RightMargin 528)
(DefaultTab 36)
(Font (0 TIMESROMAN 10 NIL NIL)
(1 TIMESROMAN 8 NIL NIL)
(2 HIPPO 8 NIL NIL)
(3 GACHA 8 NIL NIL)
(4 MATH 8 NIL NIL)
(5 HELVETICA 12 NIL NIL)
(6 GACHA 6 NIL NIL)
(7 TIMESROMAN 9 NIL NIL)
(8 HELVETICA 10 NIL NIL)
(9 HELVETICA 11 NIL NIL)))

((ParagraphLeading 12)
(LineLeading 6)
(FirstLineLeftMargin 84)
(LeftMargin 84)
(RightMargin 528)
(DefaultTab 18)
(Font (0 HELVETICA 10 NIL NIL)
(1 HELVETICA 8 NIL NIL)
(2 LOGO 24 NIL NIL)
(3 MATH 10 NIL NIL)
(4 HIPPO 10 NIL NIL)
(5 TIMESROMAN 12 NIL NIL)
(6 HELVETICA 10 NIL NIL)
(7 HELVETICA 8 NIL NIL)
(8 GACHA 10 NIL NIL)
(9 HELVETICA 18 NIL NIL)))

@masinter
Copy link
Member Author

if we're running HCFILES to do a bulk transform of .bravo to PDF conversion, asking the user for a "user.cm" file isn't useful. I think if there isn't a user.cm or some other renaming that we can hint at, picking the same font choices as Paul did will at least aid in reviewing the comparison between Paul's bravo converter to going through TEdit.

@rmkaplan
Copy link
Contributor

rmkaplan commented May 10, 2025 via email

@pmcjones
Copy link

Here's the case statement in my code that handles fonts:

switch (c_l.font) {
    case 0: name = "serif"; size = 10; break;       // want Times Roman
    case 1: name = "serif"; size =  8; break;       // want Times Roman
    case 2: name = "monospace"; size = 18; break;   // really XEROX logo (just E O R X)
    case 3: name = "math"; size = 10; break;
    case 4: name = "greek"; size = 10; break;
    case 5: name = "serif"; size = 12; break;       // want Times Roman
    case 6: name = "sans-serif"; size = 10; break;  // want Helvetica
    case 7: name = "sans-serif"; size =  8; break;  // want Helvetica
    case 8: name = "monospace"; size = 10; break;   // want Gacha
    default: name = "serif"; size = 10; break;      // treat like 0
}

@masinter masinter added this to tedit May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants