bugtipauni - Bugs: bug #539, Avoid unconditional loading of...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #539: Avoid unconditional loading of CharisSIL

Submitted by:  Lemures Lemniscati <lemniscati>
Submitted on:  Sat Jan 8 22:55:51 2022  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: Ready For Test
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Mon Feb 21 11:55:59 2022, comment #176:

Thank you! :)

Lemures Lemniscati <lemniscati>
Mon Feb 21 05:12:19 2022, comment #175:

Thanks for your help so far. I have released the new version. Unfortunately there seems to be another bug (not in my package, but in the Charis SIL font). I spotted it after the release. I have requested the CTAN managers to hold the announcement if possible. All the PDFs are messed up because of wrong rendering of the IPA characters. You can check the latest PDFs from the git repository or from the CTAN page of the package.

Anyways closing this bug report now. Thanks again :)

निरंजन <niruvt>
Project Administrator
Sun Feb 20 10:36:55 2022, comment #174:

All right. You are the leader.

I'm satified with having the option preservefont:

1. Avoid unconditional loading of CharisSIL.
2. Be able to skip doing \setmainfont in the package.

I'll try not to mind any more :).

Thank you for developing the excellent package.

Sincerely,

Lemures Lemniscati <lemniscati>
Sun Feb 20 08:06:41 2022, comment #173:

Sorry for the missing link.

[...] has mentioned here that it might [...]

निरंजन <niruvt>
Project Administrator
Sun Feb 20 08:00:56 2022, comment #172:

A correction.

The empty fontspecoptions, i.e., fontspecoptions= or fontspecoptions={} are treated differently than the noval option, i.e., fontspecoptions. As Jonathan Spratte has mentioned here, that it might be handy to reset fontspecoptions with an empty value. Hence we are using the estore type for that key instead of code.

निरंजन <niruvt>
Project Administrator
Sun Feb 20 07:53:35 2022, comment #171:

> Redundancy can also be an objective problem (although it might be subjective what kind of redundancy is too excessive), in my opinion.


Exactly! The feeling of whether something is needed or not is (at least in this case) just personal.

> Ah, I think I've found an inconsistency.


This is an intended inconsistency, because I actually just ignore the empty/noval fontspecoptions and do nothing, but I do not just ignore the empty/noval documentfont option. There is a behavior (selecting the value of a non-empty documentfont if given) which is not the same with fontspecoptions. Also I had specifically said logical inconsistency. e.g. Like spotted in this comment of mine where the same setting is behaving inconsistently. The inconsistency you have mentioned isn't the one which I was talking about. Such inconsistencies are bound to occur with different behaviors of options.

> Completion of the codes for the cases which is not treated yet.


Rather than having code for all of these cases I have added a few lines in the documentation. The value-taking options and non-value-taking-options are now separated in the documentation. Please refer to the latest PDF or the dtx. In my opinion matching each and every option isn't necessary. Also the error message from package expkv is also pretty helpful. With a clear documentation I guess this won't be a problem.

> As the warning message for a `fontspecoptions` with no value.


I have pushed some code now which has the change you have mentioned here. I liked it. Thanks.

निरंजन <niruvt>
Project Administrator
Wed Feb 16 14:24:30 2022, comment #170:

As the warning message for a `fontspecoptions` with no value,
this would be better (partially corresponing to `documentfont` with no value).
or

Lemures Lemniscati <lemniscati>
Wed Feb 16 14:10:05 2022, comment #169:

Ah, I think I've found an inconsistency.

The case of a `fontspecoptions` with no value is defined as

And its warning message is shorter than that of a `documentfont` with no value.

Lemures Lemniscati <lemniscati>
Wed Feb 16 13:54:38 2022, comment #168:

In reply to comment #165:

> Is there anything left now?


Completion of the codes for the cases which is not treated yet.

\usepackage[preservefont=]{tipauni}

\usepackage[recommendedfont=]{tipauni}

\usepackage[resetfontoptions=]{tipauni}

Lemures Lemniscati <lemniscati>
Wed Feb 16 13:37:02 2022, comment #167:

> Maybe let's agree to disagree here :)


All right. The project is yours.

> The reason I am saying this is I don't have any objective reason for why I think it is necessary and neither do I see any objective problem (like, say, logical inconsistency) in these messages. Two people having two different minds can maybe never agree on subjective points, so in my opinion we shouldn't waste our energy in justifying our (including mine) subjective points.


Redundancy can also be an objective problem (although it might be subjective what kind of redundancy is too excessive), in my opinion.
I think the eventual purpose of my efforts about this is just to make the code and the design more simple. But that has reminded me of the diffenrence between our preferences about coding.
So, I agree to disagree here :).

Lemures Lemniscati <lemniscati>
Wed Feb 16 12:12:11 2022, comment #166:

Not explicitly said in the earlier comment; but:

> I don't have any objective reason for why I think it is necessary


implies that I think that it is useful. I just can't explain the reasons objectively.

निरंजन <niruvt>
Project Administrator
Wed Feb 16 11:57:25 2022, comment #165:

> Please, provide a valid fontname.


I liked this. I'll make this change. Thanks.

> Now, I think it is unncessary, because it is useless for fixing the wrong usage of documentfont.
> But, I don't think such a care is necessary.


Maybe let's agree to disagree here :)

The reason I am saying this is I don't have any objective reason for why I think it is necessary and neither do I see any objective problem (like, say, logical inconsistency) in these messages. Two people having two different minds can maybe never agree on subjective points, so in my opinion we shouldn't waste our energy in justifying our (including mine) subjective points.

Is there anything left now? If not, I will push the changes with the documentation as it is and use the code with the change mentioned in this message.

निरंजन <niruvt>
Project Administrator
Wed Feb 16 11:25:13 2022, comment #164:

In reply to the comment #163:

About the part `Please provide a value,'
these might be better candidates:
`Please, provide a non-empty value'
`Please, provide a valid fontname.'

About the part `otherwise....',
Now, I think it is unncessary, because it is useless for fixing the wrong usage of documentfont.

In reply to the comment #160:

> I think "unless another font is set" part of the current help message shall take care of the case you have described.

Yes, I think it does care.
But, I don't think such a care is necessary.

Lemures Lemniscati <lemniscati>
Tue Feb 15 18:00:14 2022, comment #163:

Sorry, there were some grammatical errors which are resolved in the following.

The first one:

The second one:

निरंजन <niruvt>
Project Administrator
Tue Feb 15 17:52:37 2022, comment #162:

Revised, proposed and unpushed help message with `documentfont'

Revised, proposed and unpushed help message with `documentfont={}'

Thoughts?

निरंजन <niruvt>
Project Administrator
Tue Feb 15 13:31:22 2022, comment #161:

Now, it is an error, not a warning.
So it has come up to mind that a result of an error can be any, or even undefined.

So the messages can be
"The `documentfont' option has no value."
"The `documentfont' option has an empty value."

or,
"The `documentfont' option has no value, and its result is undefined."
"The `documentfont' option has an empty value, and its result is undefined."

or,
"The `documentfont' option has no value, and it is ignored.
"The `documentfont' option has an empty value, and it is ignored."

Although the last candidate requires modification of the design, it will make the codes simpler.

Currently, I prefer the first candidate or the last one.

Lemures Lemniscati <lemniscati>
Tue Feb 15 02:49:03 2022, comment #160:

I think "unless another font is set" part of the current help message shall take care of the case you have described. Can you think of any betterment of this message?

निरंजन <niruvt>
Project Administrator
Mon Feb 14 20:04:23 2022, comment #159:

About the comment #155 of mine.

> > Also the errors are thrown in both the cases.
> I think these behaviors are consistent.


Sorry, this is ambiguous.

I mean it is consistent that errors are thrown in both the cases,
from the viewpoint about which is thrown, an error or a warning.
(I don't mean the error messages are consistent. I don't mean the other behaviors are consistent.)

Lemures Lemniscati <lemniscati>
Mon Feb 14 12:34:46 2022, comment #158:

Again,
for the case (the second option is `documentfont` with no value):

The help message and the results conflict.

The help message:

The results:

Lemures Lemniscati <lemniscati>
Mon Feb 14 12:26:46 2022, comment #157:

Sorry.
The message and the results of comment #155 is that of

The second option is `documentfont=`.

Lemures Lemniscati <lemniscati>
Mon Feb 14 12:18:26 2022, comment #156:

> Sorry, comment #153 is about the code before comment #151


And, please, forget about some debug option(s).

Lemures Lemniscati <lemniscati>
Mon Feb 14 12:04:21 2022, comment #155:

In reply to comment #151 and comment #152

> now I have removed the warning messages, but please note that it is still not equivalent to the preservefont. The \tipauni@document@font is still set conditionally.


In this case, the help message and the results conflict.

Help message:

Results:

> Also the errors are thrown in both the cases.

I think these behaviors are consistent.

Lemures Lemniscati <lemniscati>
Mon Feb 14 11:35:38 2022, comment #154:

Sorry, comment #153 is about the code before comment #151

Lemures Lemniscati <lemniscati>
Mon Feb 14 11:27:09 2022, comment #153:

I doubt the long warning messages are useful.

When a user see a warning or an error about a wrong usage of documentfont with a reason (no value, or an empty value), it suffices to help fixing.

On the other hand, in the current design, a documentfont option with no value or with an empty value might be used as an option for debug in order to know what font (including a case of no font) is to be loaded at that point (assuming not otherwise specified later). If such a usage is intended, it's better to have some debug option(s)... (in my opinion),

Lemures Lemniscati <lemniscati>
Mon Feb 14 10:50:56 2022, comment #152:

Also the errors are thrown in both the cases.

निरंजन <niruvt>
Project Administrator
Mon Feb 14 10:49:03 2022, comment #151:

Okay. I would have still kept it, but I spotted another problem, which is in a case like following.

This would lead to inconsistent behavior if the options are flipped. The above example results in errors, but if you reverse their order, no error will be prompted. Hence now I have removed the warning messages, but please note that it is still not equivalent to the preservefont. The \tipauni@document@font is still set conditionally.

निरंजन <niruvt>
Project Administrator
Mon Feb 14 10:16:44 2022, comment #150:

All right.

In the comment #120,

Although treating the specific case in it,
I meant it without any assumption in this part (not specific to the case).

> Do you mean by "not used correctly", a case in which `documentfont` has no value (`documentfont`, withtout `=`), and a case in which documentfont has an empty value (`documentfont=`, with `=` but with an empty value) ?
> If so, I agree that `documentfont` should behave like `preservefont` in these cases. And, it was the first solution :) (cf. https://puszcza.gnu.org.ua/bugs/?539#comment0).
> I'll be happy if this is accepted.


And it was my fault not saying it explicitly with `without any assumption (not specific to the case)'.

Lemures Lemniscati <lemniscati>
Mon Feb 14 09:49:47 2022, comment #149:

Sorry for the wrong wording, I meant the other case is the one when the documentfont option is passed with an empty value or without a value, but some font has been loaded successfully with the `tipauni' package.

निरंजन <niruvt>
Project Administrator
Mon Feb 14 09:46:32 2022, comment #148:

> Assuming there is no font defined before the current option.


This isn't an `assumption'. It is a `case' as I would like to call it. There are two cases I have identified. One is when a document is passed with an empty value or without a value and the other one is when it is passed with an empty value or without a value. I still don't think I am assuming anything.

निरंजन <niruvt>
Project Administrator
Mon Feb 14 08:50:29 2022, comment #147:

> I am not sure if I understand you correctly, what do you think I am assuming?


Assuming there is no font defined before the current option.

Lemures Lemniscati <lemniscati>
Mon Feb 14 08:30:49 2022, comment #146:

> I know it, and it means they do not always cause errors when documentfont has no value or an empty value.


Yes, they don't and that is intended, because the warning users will receive will clearly state what is going to happen. I don't think that would create much of a problem.

> Implicit assumptions are apt to cause misunderstanding, in my opinion.


I am not sure if I understand you correctly, what do you think I am assuming?

निरंजन <niruvt>
Project Administrator
Mon Feb 14 08:26:14 2022, comment #145:

In reply to comment #142

>> These codes are for warnings not for errors.


>You are right, but these codes are used only when \tipauni@font is defined before loading the current option.


I know it, and it means they do not always cause errors when documentfont has no value or an empty value.

Implicit assumptions are apt to cause misunderstanding, in my opinion.

Lemures Lemniscati <lemniscati>
Mon Feb 14 08:21:57 2022, comment #144:

> In order to avoid unexpected bugs, the states of the parameters should be controlled exactly, in my opinion.


In fact matching the codes might strike unexpected results. Let's say in future I want something which tests if \tipauni@font is defined or not, it would match with both preservefont and empty+noval documentfont which I wouldn't want. With the earlier design I had the privilege to set \preservefont to true or false, but now I don't have such a conditional. So it's better to undefine it only with preservefont option. It'll maintain a distinction.

> And, clearly, \tipauni@document@fonttrue does not match.


Again you are on a wrong branch. \tipauni@document@fonttrue is only used when there is some font defined before the current option like in the example given in my previous comment. If you check the else branch of that conditional; you would see \tipauni@document@fontfalse which is identical to preservefont. Please note that if I had \tipauni@document@fonttrue with empty+noval documentfont, it would have given me a fontspec error, because, there is no font-name given. To understand what I mean try \setmainfont{} with package fontspec.

निरंजन <niruvt>
Project Administrator
Mon Feb 14 08:14:02 2022, comment #143:

In reply to comment #139,

> `documentfont` and `documentfont=` do not behave like `preservefont`.


>They just don't set \let\tipauni@font\tipauni@undefined. I don't see any reason where it would be absolutely necessary. Behaviorally they match exactly as setmainfont isn't executed. Code wise they don't match, I agree, but why would you insist to make \tipauni@font* undefined by \letting it be \tipauni@undefined?


In order to avoid unexpected bugs, the states of the parameters should be controlled exactly, in my opinion.

And, clearly, \tipauni@document@fonttrue does not match.

Lemures Lemniscati <lemniscati>
Mon Feb 14 08:06:39 2022, comment #142:

> These codes are for warnings not for errors.


You are right, but these codes are used only when \tipauni@font is defined before loading the current option. So something like:

or

This is achieved with the \ifdefined conditional. Please see the else branch of that conditional. There you will see the real code for the error. (Line number 549ff and 570ff from the latest dtx.)

# Code from line 549ff

# Code from line 569ff

निरंजन <niruvt>
Project Administrator
Mon Feb 14 07:57:56 2022, comment #141:

In reply to comment #138:

> > Another choice (change of the design), is that both of `documentfont` and `documentfont=` should cause errors.


> They do!


These codes are for warnings not for errors.
So they doen't do unless the codes are dead.

Lemures Lemniscati <lemniscati>
Mon Feb 14 07:43:37 2022, comment #140:

Sorry for wrong formatting.

निरंजन <niruvt>
Project Administrator
Mon Feb 14 07:43:03 2022, comment #139:

> `documentfont` and `documentfont=` do not behave like `preservefont`.


They just don't set *\let\tipauni@font\tipauni@undefined. I don't see any reason where it would be absolutely necessary. Behaviorally they match exactly as setmainfont isn't executed. Code wise they don't match, I agree, but why would you insist to make \tipauni@font* undefined by *\letting it be \tipauni@undefined*?

निरंजन <niruvt>
Project Administrator
Mon Feb 14 07:38:17 2022, comment #138:

> Another choice (change of the design), is that both of `documentfont` and `documentfont=` should cause errors.


They do!

With this code:

I get this error:

and this help message:

whereas with this code:

I get:

and the following help message:

निरंजन <niruvt>
Project Administrator
Mon Feb 14 07:30:58 2022, comment #137:

Another choice (change of the design), is that both of `documentfont` and `documentfont=` should cause errors.
I guess you proposed it formerly at first from the viewpoint of semantics (I'm not sure).

But this time, treat an empty string as a usual fontname, and
it brings an error from \setmainfont. This is same as a case in which a given fontname is wrong.

It will simplify the codes.

Lemures Lemniscati <lemniscati>
Mon Feb 14 06:33:07 2022, comment #136:

It might be a choice to make `documentfont` with no value cause error, since `documentfont` and `documentfont=` are now distinguishable by the expkv-* packages.

That is, `documentfont` should take a value (as a modification of the current design).

Lemures Lemniscati <lemniscati>
Mon Feb 14 06:09:50 2022, comment #135:

This is not modified yet (cf. Comment #127)
`documentfont` and `documentfont=` do not behave like `preservefont`.

Keep the definition of `preservefont` in mind.

The definition of `documentfont` (with no value) doesn't match that of `preservefont`.

The definition of `documentfont=` (with an empty value) doesn't match that of `preservefont`.

Lemures Lemniscati <lemniscati>
Mon Feb 14 05:55:48 2022, comment #134:

By the way I forgot to mention that the code in question (the one using \expandafter) was given by Jonathan Spratte only.

निरंजन <niruvt>
Project Administrator
Mon Feb 14 05:45:58 2022, comment #133:

> Is there any case in which it does not work?


Expansion is a weird beast in TeX and I am no expert in this area and hence I have transferred your question as it is to Jonathan Spratte here. Let us wait for their response.

निरंजन <niruvt>
Project Administrator
Mon Feb 14 05:38:22 2022, comment #132:

> What is resolved would you think?


I think even though the difference is just of two-three words, it conveys the fact that only the last active font is mentioned. So (referring back to the example I had given) there is no reason left to expect the lmr10 being reported. So it looks better to me **now**.

निरंजन <niruvt>
Project Administrator
Mon Feb 14 05:23:16 2022, comment #131:

> I guess, generally speaking, the more we want to control, the more we'd care to keep consistency and clarity. And the codes will follow.


You are right, but I guess I have reduced the complexity way too much now. All the code can be easily seen and comprehended in one glance. I had made it **so** complex that even I wasn't able to understand it (very sorry for that), but if 1) the current code satisfies the requirements (which both of us believe that it does) and 2) we test it enough (which also I believe with the l3-test-suit I have managed to do. I plan to increase the test-files.) 3) and it is not absolutely incomprehensible; I guess we can give it a try.

निरंजन <niruvt>
Project Administrator
Mon Feb 14 05:05:09 2022, comment #130:

> For what purpose, is it necessary to do `\let\tipauni@font\tipauni@recommended@font` even when \tipauni@document@fontfalse?


I actually had a thought about this and I was also not happy with defining it unconditionally, but I couldn't come up with a solution hence I kept it like it is. Anyways there was no behavioral side-effect, but I am glad that you found out a workaround. Thanks! I have pushed this change :)

निरंजन <niruvt>
Project Administrator
Mon Feb 14 00:54:19 2022, comment #129:

For what purpose, is it necessary to do `\let\tipauni@font\tipauni@recommended@font` even when \tipauni@document@fontfalse ?

It is better like this (in my opinion):

Lemures Lemniscati <lemniscati>
Sun Feb 13 23:26:41 2022, comment #128:

> Anything else? Do you think the current code is safer and less buggy than the earlier one?


Maybe, maybe not.

I'm not familiar with expkv-* packages. But they looks very powerful and able to control more subtle things.

I guess, generally speaking, the more we want to control, the more we'd care to keep consistency and clarity. And the codes will follow.

> Does it provide what you had asked for?


I think my minimum requirement is safisfied.
1. Avoid unconditional loading of CharisSIL.
2. Be able to skip doing \setmainfot in the package.

Lemures Lemniscati <lemniscati>
Sun Feb 13 22:40:57 2022, comment #127:

> > Do you mean by "not used correctly", a case in which `documentfont` has no value (`documentfont`, withtout `=`), and a case in which documentfont has an empty value (`documentfont=`, with `=` but with an empty value) ?
> > If so, I agree that `documentfont` should behave like `preservefont` in these cases. And, it was the first solution :) (cf. https://puszcza.gnu.org.ua/bugs/?539#comment0).
> > I'll be happy if this is accepted.


> Great! :) I see that it was what you already had proposed. I don't know why I thought loading CharisSIL would be better in such cases, but never mind. I agree with you now. It seems that we agree on most (all?) of the points now.


I agree most, but not all :).

Lemures Lemniscati <lemniscati>
Sun Feb 13 22:18:58 2022, comment #126:

By the way (out of the scope of this thread),

what is the reason this sequence is necessary?

A following code seems to work

Is there any case in which it does not work?

Lemures Lemniscati <lemniscati>
Sun Feb 13 21:55:24 2022, comment #125:

I don't think so, because the situation is as same as

> Seeing multiple font-names while only the last one will have the effect


> Also we can't really specify ALL the names.

...

> This will report two names. 1) cmr10 2) DoulosSIL; while we had loaded three fonts. The lmr10 cannot be reported with the current design and I don't see any obvious way to report it.
> Therefore it feels weird, but it seems reasonable to report the name of the last active font too. It just gives a detailed picture of the used code. Hence I am a bit confused.


What is resolved would you think?

Lemures Lemniscati <lemniscati>
Sun Feb 13 15:05:04 2022, comment #124:

I think I would just change the warning message a bit like in this commit. This shall suffice.

Anything else? Do you think the current code is safer and less buggy than the earlier one? Does it provide what you had asked for?

निरंजन <niruvt>
Project Administrator
Sun Feb 13 10:20:41 2022, comment #123:

And it could be an extreme choice: leave fontspec matters to the fontspec package, and make these options deprecated...

Lemures Lemniscati <lemniscati>
Sun Feb 13 09:56:25 2022, comment #122:

> Seeing multiple font-names while only the last one will have the effect feels weird to me.


> Also we can't really specify ALL the names.

...

> This will report two names. 1) cmr10 2) DoulosSIL; while we had loaded three fonts. The lmr10 cannot be reported with the current design and I don't see any obvious way to report it.
> Therefore it feels weird, but it seems reasonable to report the name of the last active font too. It just gives a detailed picture of the used code. Hence I am a bit confused.


So, your choices might be:

  1. Make us see only the last effective font-name.
  2. Reconsider the current design.
  3. Assuming that there is no obvious way, reconsider whether it is really necessary what you want.
Lemures Lemniscati <lemniscati>
Sun Feb 13 04:39:53 2022, comment #121:

> I'll be happy if this is accepted.


Great! :) I see that it was what you already had proposed. I don't know why I thought loading CharisSIL would be better in such cases, but never mind. I agree with you now. It seems that we agree on most (all?) of the points now.

> Please, clarify the points of weirdness. They could be clues to a solution.


Seeing multiple font-names while only the last one will have the effect feels weird to me. Also we can't really specify ALL the names. e.g. Try this:

This will report two names. 1) cmr10 2) DoulosSIL; while we had loaded three fonts. The lmr10 cannot be reported with the current design and I don't see any obvious way to report it.

Therefore it feels weird, but it seems reasonable to report the name of the last active font too. It just gives a detailed picture of the used code. Hence I am a bit confused.

निरंजन <niruvt>
Project Administrator
Sun Feb 13 00:29:14 2022, comment #120:

Hi!

> # Regarding https://puszcza.gnu.org.ua/bugs/?539#comment116
> I thought about this problem. Currently my viewpoint is if a person has used documentfont option, certainly they want to change CharisSIL. They haven't used the option correctly is a problem that we have understood, but still as we are sure that they don't want CharisSIL, we can directly shift to lmr in my opinion. Would like to hear more about this from you.


Do you mean by "not used correctly", a case in which `documentfont` has no value (`documentfont`, withtout `=`), and a case in which documentfont has an empty value (`documentfont=`, with `=` but with an empty value) ?
If so, I agree that `documentfont` should behave like `preservefont` in these cases. And, it was the first solution :) (cf. https://puszcza.gnu.org.ua/bugs/?539#comment0).
I'll be happy if this is accepted.


> # Regarding https://puszcza.gnu.org.ua/bugs/?539#comment115
> You are correct. I have made this change.


Thanks!


> # Something similar to https://puszcza.gnu.org.ua/bugs/?539#comment75

...

> Do you think this is desirable? Honestly speaking, I am unsure about this. It looks okay, but weird too. Would like to hear your thoughts regarding this.


Please, clarify the points of weirdness. They could be clues to a solution.

Regards,

Lemures Lemniscati <lemniscati>
Sat Feb 12 19:10:17 2022, comment #119:

Hello Lemures,

After a long code review which happened here; I have changed the design of the package-options. The latest code is pushed to the `exp-warnings' branch. I have removed a lot of unnecessary conditionals. I have used a faster package for options. I have removed the complicated and bug-prone processing of conditional cases. Though your wish was just to `avoid unconditional loading of CharisSIL', I believe it has eventually brought a lot of good things into the package.

# Regarding https://puszcza.gnu.org.ua/bugs/?539#comment116

I thought about this problem. Currently my viewpoint is if a person has used documentfont option, certainly they want to change CharisSIL. They haven't used the option correctly is a problem that we have understood, but still as we are sure that they don't want CharisSIL, we can directly shift to lmr in my opinion. Would like to hear more about this from you.

# Regarding https://puszcza.gnu.org.ua/bugs/?539#comment115

You are correct. I have made this change.

# Something similar to https://puszcza.gnu.org.ua/bugs/?539#comment75

If you now load the package like this:

You will get this in your log:

Do you think this is desirable? Honestly speaking, I am unsure about this. It looks okay, but weird too. Would like to hear your thoughts regarding this.

Apart from this, there were **so** many things discussed on this thread that at a point of time I felt absolutely lost. If I have missed any of your points, 1) Sorry about that, 2) Please bring it to my notice again. Ignoring your point wasn't the intention. It's just that it might have slipped out of my mind unknowingly.

निरंजन <niruvt>
Project Administrator
Mon Feb 7 12:53:04 2022, comment #118:

Thank you, निरंजन, for developing the package.

My wish is just to #539: Avoid unconditional loading of CharisSIL

In my opinion, it seems that the goal has become too big and too complicated. A smaller goal will be easier to be accomplished.

Please, try it later when you are available.

Thank you, again.

Lemures Lemniscati <lemniscati>
Mon Feb 7 10:37:02 2022, comment #117:

Hello Lemures,

I will need more time to work on all the points that are so far mentioned as well as here. I will come back with something better. Thanks for your patience.

निरंजन <niruvt>
Project Administrator
Thu Feb 3 09:32:44 2022, comment #116:

About the file empty-documentfont.tlg

According to the agreeement in comment #95, it would be like this:

Related comments are comment #90, comment #91, comment #92, and comment #93.

Lemures Lemniscati <lemniscati>
Wed Feb 2 23:23:06 2022, comment #115:

It seems that the name of the file `empty-and-nonempty-documentfont.lvt' <https://git.gnu.org.ua/tipauni.git/tree/tipauni/testfiles/empty-and-nonempty-documentfont.lvt?id=28c7fdc1f3fa2dc13f2bae68002732b45a10a15d> should be renamed to `nonempty-and-empty-documentfont.lvt'.

The order of thw words `nonempty' and `empty' seems to be reversed.

Lemures Lemniscati <lemniscati>
Tue Feb 1 12:01:58 2022, comment #114:

The description in the comment #111 looks explaining completely.
But it looks difficult to me.
Expert reviewers will make better suggestions than me.

Anyway, I guess, it's fine that all the behaviors of the options are described.

Let's go ahead.

Thank you for developing the package!

Lemures Lemniscati <lemniscati>
Tue Feb 1 11:40:58 2022, comment #113:

>> 2. The phrase `So if a \verb|documentfont| is added after a \verb|preservefont|, the former will override the later' makes sense.
>> But, the situation is that `the former' one is placed after `the latter' one in a sequence of options, here.
>> This semms like a situation that there are a green-colored word 'red' and a red-colored word `green'.
>> So, it makes me uneasy.
>> And, I guess, this would be an improved phrase
>> ----
>> So if a \verb|documentfont| is followed by a \verb|preservefont|, the former will be overridden by the latter.
>> ----
> Again, the phrase you have suggested isn't wrong, but I think you are missing the fact that the documentfont option can also override the preservefont if it has the highest priority. So there is nothing wrong in my statement too. For the clarity, I have made the statement like following:
> ---
> Please note that every option so far mentioned can potentially override each other. e.g. If a documentfont is added after a preservefont, the former will override the latter (& vice versa). It is true for all these three package options.
> ---


I know the sentence makes sense and nothing wrong.

I guess, using `E.g.,' here, as you write, is very proper. In fact, the phrase after `So' was just a specific example for telling how the rules worked, and so the phrase did not need mentioning about all cases.
So I think `(& vice versa)' is unnecessary as the pharse you write previously.

But my concerning point is somewhat diffrent.
Maybe my explanation was bad.

My concern is that the properties of the contents does not seem to fit what they are called.

I would be perplexed in the situation when I am orally asked to select the former one from a written sequence of the strings `the latter one' and `the former one', because the contents of the strings does not fit what they are called.

Expressions like this would need careful reading, and might exhaust readers, just in my opinion (not necessary to mind it).

Thank you for your patience.

Lemures Lemniscati <lemniscati>
Tue Feb 1 10:19:12 2022, comment #112:

>> 1. The phrase `can potentially override' sounds rather obscure.
> I don't think it is obscure. What I am trying to say here is they can override each other. I am trying to state what they can do. I am not saying what you have stated is wrong, but it doesn't contradict what I am trying to say. Both our views are correct and I think in a manual, I shall only state what my features can do.


Although I think I know what you are trying to state, I just mean that `it can do' and `it does' are different.
But, my viewpoint might be too literal.
Please, don't mind.

Lemures Lemniscati <lemniscati>
Tue Feb 1 07:09:02 2022, comment #111:

> It refers neither a case in which recommendedfont is used, nor a case in which none of recommendedfont and documentfont is used.


The description is now:

---
This option can be used to set options to the font set with documentfont package option. If the recommendedfont option is used & has the highest priority; the options set with fontspecoptions will be used with the Charis SIL font. If the preservefont option has the highest priority, this parameter will be ineffective & throw a warning. In the argument of this option write as if you are writing in the optional parameter of the \setmainfont command.
---

I am adding a general note after resetfontspecoptions which is like following:

---
As noted for the font-options, these parameters which deal with the options of the loaded fonts also can override each other. The last one loaded will be considered of the highest priority.
---

निरंजन <niruvt>
Project Administrator
Tue Feb 1 06:18:36 2022, comment #110:

> 1. The phrase `can potentially override' sounds rather obscure.


I don't think it is obscure. What I am trying to say here is they can override each other. I am trying to state what they can do. I am not saying what you have stated is wrong, but it doesn't contradict what I am trying to say. Both our views are correct and I think in a manual, I shall only state what my features can do.

> And, I guess, this would be an improved phrase


Again, the phrase you have suggested isn't wrong, but I think you are missing the fact that the documentfont option can also override the preservefont if it has the highest priority. So there is nothing wrong in my statement too. For the clarity, I have made the statement like following:

---
Please note that every option so far mentioned can potentially override each other. e.g. If a documentfont is added after a preservefont, the former will override the latter (& vice versa). It is true for all these three package options.
---

निरंजन <niruvt>
Project Administrator
Mon Jan 31 10:50:57 2022, comment #109:

In the commit https://git.gnu.org.ua/tipauni.git/commit/?id=d9097a0970f3f2b5221c68f5046883b7284d57d0

It refers neither a case in which recommendedfont is used, nor a case in which none of recommendedfont and documentfont is used.
If it is intended, an explanation for those cases is also required.

And, if it is intended, it should be explained that every fontspecoptions or resetfontspecoptions overrides each other, i.e., the last specified one of fontspecoptions or resetfontspecoptions is effective (overrides the other(s), if any).

Lemures Lemniscati <lemniscati>
Mon Jan 31 08:07:14 2022, comment #108:

Thank you for documenting. It's a hard task.

In the commit https://git.gnu.org.ua/tipauni.git/commit/?id=d2f0d17f92a21eed902da305c54bf34a2059257a,

1. The phrase `can potentially override' sounds rather obscure.
Replacing it by `overrides' would make it clearer, in my opinion.

2. The phrase `So if a \verb|documentfont| is added after a \verb|preservefont|, the former will override the later' makes sense.
But, the situation is that `the former' one is placed after `the latter' one in a sequence of options, here.
This semms like a situation that there are a green-colored word 'red' and a red-colored word `green'.
So, it makes me uneasy.

And, I guess, this would be an improved phrase:


So if a \verb|documentfont| is followed by a \verb|preservefont|, the former will be overridden by the latter.


It is also in my opinion.

Lemures Lemniscati <lemniscati>
Mon Jan 31 05:06:54 2022, comment #107:

Apologies for the mistakes. All of them are corrected now.

I'll start a code review now.

निरंजन <niruvt>
Project Administrator
Mon Jan 31 04:58:11 2022, comment #106:

In the commit https://git.gnu.org.ua/tipauni.git/commit/?id=d9097a0970f3f2b5221c68f5046883b7284d57d0

According to the agreeement in comment #95,
preservefont overrides recommendedfont and documentfont. But, it is not documented.

According to the agreeement in comment #95,
recommendedfont overrides preservefontont also.
But, it is not documented.

According to the agreeement in comment #95,
documentfont overrides preservefont and recommendedfont.
But it is not documented yet.

Lemures Lemniscati <lemniscati>
Mon Jan 31 04:06:57 2022, comment #105:

In the commit https://git.gnu.org.ua/tipauni.git/commit/?id=d9097a0970f3f2b5221c68f5046883b7284d57d0

A documentation of resetfontspecoptions is identical to that of recommendedfont.

If this is intended, resetfontspecoptions would be unnecessary.

Lemures Lemniscati <lemniscati>
Mon Jan 31 03:47:09 2022, comment #104:

In the commit https://git.gnu.org.ua/tipauni.git/commit/?id=d9097a0970f3f2b5221c68f5046883b7284d57d0

A documentation of recommendedfont is duplicated.

Lemures Lemniscati <lemniscati>
Sun Jan 30 23:20:17 2022, comment #103:

In the commit https://git.gnu.org.ua/tipauni.git/commit/?h=exp-warnings&id=0c4a7bb4260ad0503e6cdc308099006a25fc34d4

But these two are not bugs in the documentation.

Lemures Lemniscati <lemniscati>
Sun Jan 30 22:54:37 2022, comment #102:

> Please check this branch which has all the new changes.


I'd like to leave it to the author and other reviewers.
I'm really tired/weary of checking complictated codes.

Lemures Lemniscati <lemniscati>
Sun Jan 30 22:45:37 2022, comment #101:

> Note that it has a few extra changes which are not present in the patches I have so far sent here.


In the commit https://git.gnu.org.ua/tipauni.git/commit/?h=exp-warnings&id=d9097a0970f3f2b5221c68f5046883b7284d57d0, an documentation about the `incompatible' option is silently removed.

But I don't know whether it is intended or not.

Lemures Lemniscati <lemniscati>
Sun Jan 30 14:44:12 2022, comment #100:

> After the file #471, the code in comment #96 made an unexpected result, until the file #488.


Correct! Thanks for pointing that out.

Please check this branch which has all the new changes. Note that it has a few extra changes which are not present in the patches I have so far sent here.

निरंजन <niruvt>
Project Administrator
Sun Jan 30 10:40:08 2022, comment #99:

After the file #471, the code in comment #96 made an unexpected result, until the file #488.

Lemures Lemniscati <lemniscati>
Sun Jan 30 08:43:55 2022, comment #98:

> There was a stupid mistake in the code to which I didn't pay much attention.


Oh, I'm temped to say something like in the comment #85.

Thank you for developing!

Lemures Lemniscati <lemniscati>
Sun Jan 30 08:35:25 2022, comment #97:

> I believe that I have developed all the features you requested for.

Yes.
They are more than what I requested, since all I need is the option preservefont.

> So can we postpone the decision regarding the warning messages for the time being?

I agree.

Thank you for developing the package!

Lemures Lemniscati <lemniscati>
Sun Jan 30 06:29:36 2022, comment #96:

There was a stupid mistake in the code to which I didn't pay much attention. I had issued \documentfontfalse in the code unconditionally before defining the features. It broke the most basic function of the package tipauni, i.e., to load Charis SIL :P

Try this code both with and without merging the attached patch to see how stupid terrifying was.

निरंजन <niruvt>
Project Administrator
Sun Jan 30 06:06:07 2022, comment #95:

> I posted it as a reformatted memo of comment #77, which I thought being discarded.


Yes I missed it.

> It is newly suggested under the assumption you might want it. I don't know whether you want it or not.


Initially I wasn't much convinced, but then I thought it is a feature worth developing by the same logic that I applied to others. One might want to just forget everything and load Charis SIL by a simple \PassOptionsToPackage command and for which two three lines of code won't hurt. So I developed it.

> Now, both of us have agreed, don't we? :).


Yes! I am glad :)

> Except about the warning message, I guess, both of us have agreed. Do you?


Yes, fully!

I think the only point where we are disagreeing is whether having three cases of ignoring the empty documentfont is necessary or not. In my opinion as far as we can help the user with knowing what is most possibly going to happen with the code they have used is a good thing. So even after ignoring the empty documentfont, we are implementing 3 different behaviors based on other options they have/have not used. Giving information about it is not a very bad idea in my opinion. There is only one case where my warnings can contradict. It is when users use fontspec commands or default font-changing commands outside of package tipauni. I think my warning message covers that case too as I have mentioned tipauni-external methods.

So I have the following proposal. I will first document the code so far we have consolidated. Create a git branch for that. Let's hear from the experts. I am not discarding the idea of a simple warning message, but currently I am willing to settle down with the "feature-requirements". I believe that I have developed all the features you requested for. So can we postpone the decision regarding the warning messages for the time being? Please note that I am not discarding your opinion, I just want to hear more voices. I hope that's fine.

Thanks for your help so far :)

निरंजन <niruvt>
Project Administrator
Sun Jan 30 00:57:33 2022, comment #94:

The other one of the candidate definitions of the behavior of the options documentfont, and preservefont (when recommendedfont is not adopted) (cf. comment #92).

  1. default: do `\setmainfont{CharisSIL}' unless otherwise specified.
  2. A preservefont option: skip doing `\setmainfont' unless otherwise specified later.
  3. A documentfont option with a nonempty value: do `\setmainfont' with its value unless otherwise specified later.
  4. A documentfont option with an empty value: be just ignored and regarded as not specifying anything, and output an descriptive warning like this:

The `documentfont' option has no value, and it is just ignored.

Lemures Lemniscati <lemniscati>
Sun Jan 30 00:56:47 2022, comment #93:

One of the candidate definitions of the behavior of the options documentfont, preservefont, and recommendedfont (cf. comment #92).

  1. A recommendedfont option (default): do `\setmainfont{CharisSIL}' unless otherwise specified later.
  2. A preservefont option: skip doing `\setmainfont' unless otherwise specified later.
  3. A documentfont option with a nonempty value: do `\setmainfont' with its value unless otherwise specified later.
  4. A documentfont option with an empty value: be just ignored and regarded as not specifying anything, and output an descriptive warning like this:

The `documentfont' option has no value, and it is just ignored.

Lemures Lemniscati <lemniscati>
Sun Jan 30 00:43:15 2022, comment #92:

Thank you for reconsidering my suggestion (comment #90).
I posted it as a reformatted memo of comment #77, which I thought being discarded.

Rule 1.

  • It is newly suggested under the assumption you might want it. I don't know whether you want it or not.
  • It should not be implemented if you don't want. But a defintion of the default behavior should be required still.

Rule 2 and Rule 3.

  • Now, both of us have agreed, don't we? :).

Rule 4.

  • Except about the warning message, I guess, both of us have agreed. Do you?
  • About the warning message in the comment #90.

> it seems to be a lot manual-like to me.
I'm glad to hear that. I think it is not only manual-like but also too long.

> The current code for an empty documentfont has two cases based on whether the preservefont is active or not and both the messages are very explanatory
I agree (as in my comment #35).

So I suggest a more simple warning message:

The `documentfont' option has no value, and it is just ignored.

I.e., only the first line of that in the comment #90.
And, I think that this message suffices to inform users of their mistakes,
and that it is not necessary to care whether preservefont is active or not.

I'll post two new candidate definitions of the behavior of the options documentfont, and preservefont (and recommendedfont, if any).

I would also like to know the opinions of expert reviewers that you have metioned.

Lemures Lemniscati <lemniscati>
Sat Jan 29 17:39:19 2022, comment #91:

1. Done now. Please see the patch.

2. Already there and working.

3. Working.

4. I think the initial part is already working as an empty documentfont does nothing in our code. About the warning message, it seems to be a lot manual-like to me. The current code for an empty documentfont has two cases based on whether the preservefont is active or not and both the messages are very explanatory IMO. So I would like to know the reason why you are insisting for a manual-like warning instead of warnings which examine the code and informs the user about their mistakes.

I found a bug in the code which I corrected in the first patch and the warning message was weird which got corrected in the second patch. I am attaching the sty also for the convenience.

Let me know what you think.

(file #485, file #486, file #487)

निरंजन <niruvt>
Project Administrator
Fri Jan 28 10:07:56 2022, comment #90:

A candidate simple definition of the behavior of the options documentfont, preservefont, and recommendedfont (This is almost same as comment #77, and reformatted).

  1. A recommendedfont option (default): do `\setmainfont{CharisSIL}' unless otherwise specified later.
  2. A preservefont option: skip doing `\setmainfont' unless otherwise specified later.
  3. A documentfont option with a nonempty value: do `\setmainfont' with its value unless otherwise specified later.
  4. A documentfont option with an empty value: be just ignored and regarded as not specifying anything, and output an descriptive warning like this:

The `documentfont' option has no value, and it is just ignored.

  1. Use `preservefont', when you want the mainfont kept untouched.
  2. Use `recommendedfont', when you want the mainfont set to the font recommended by the package (i.e. CharisSIL).
  3. Use `documentfont' with a font-name, when you want the mainfont set to the font. E.g., `documentfont=CharisSIL', `documentfont=DoulosSIL', `documentfont=DejaVuSans', etc.

Just in my personal opinion :).

Lemures Lemniscati <lemniscati>
Fri Jan 28 10:06:39 2022, comment #89:

> I will put this up to review on various sites as well as I'll take help from Jonathan Spratte.

I agree.

> After all nothing is bug-free and easy to maintain. One has to accept this fact and still proceed with the limited resources they have. This is how free software grow IMO.

I agree. And it is valuable not only accepting the fact, but also any efforts to find easier and safer ways to maintain and to fix bugs :).

Thanks for the patch file #479.

For my convenience, I'll post a reformatted suggestion of comment #77.

Now, it seems to be the time to go to a new step.
I'm waiting for an option like preservefont to be implemented.

Thank you for your patience.

Lemures Lemniscati <lemniscati>
Fri Jan 28 03:18:45 2022, comment #88:

> Oh, it sounds that the codes are difficult for maintenance
> and are apt to bring bugs...


You might be right, but let's try this way. I will put this
up to review on various sites as well as I'll take help from
Jonathan Spratte. As I said earlier, these situations might
turn out to be real cases at times and therefore I have a
feeling that this work is not useless. I won't release it
without thorough testing, but after a few rounds of review,
and expert opinions I think we can release it. After all
nothing is bug-free and easy to maintain. One has to
accept this fact and still proceed with the limited
resources they have. This is how free software grow IMO.

> No, absolutely not.


No problem :)

> I'm terribly sorry for not being able to live up to your
> expectations.


As I have said many times, it's not about expectations. It's
just what is convenient to me as a maintainer. I have a
particular style of coding which probably doesn't match with
yours and ultimately if I am maintaining the code, I'll have
to follow my style, but that doesn't discredit your ideas.
I won't obviously attribute the code to you, but I would
still like to mention this discussion in the documentation.

> For which version does the patch file #478 apply?


There was a patch before it, which I forgot to
attach. Attached now.

(file #479)

निरंजन <niruvt>
Project Administrator
Fri Jan 28 03:05:20 2022, comment #87:

> The codes are all of yours.

Sorry, I was so upset.
I mean that all the codes are yours.

Lemures Lemniscati <lemniscati>
Thu Jan 27 23:07:14 2022, comment #86:

> Well I was also thinking of offering you the co-maintainership of this project.


It hard to say but...
No, absolutely not.

The codes are all of yours.
Almost all my suggestions are declined.
I can't approve about the style and behavior of coding of that part (from my point of view).
I'm even trying to discourage shipping them out, but it fails :).
And I'll feel that it is embrassing for me if the current codes are shipped with any attribution to me.

I'm terribly sorry for not being able to live up to your expectations.

Lemures Lemniscati <lemniscati>
Thu Jan 27 22:52:24 2022, comment #85:

> Thanks for pointing the problem case (again). Actually I had developed everything to fix that problem case, but I added a wrong counter number because of which the behavior didn't change. Sorry for that. On line number 556 it should have been counter number 2 and I mistakenly kept it 3.


Oh, it sounds that the codes are difficult for maintenance and are apt to bring bugs...

> Now it is fixed and you will be prompted with the following warning.


Confirmed with file #477 for the case of comment #74.

For which version does the patch file #478 apply?
I tried it after the patch file #476, but it failed.

Lemures Lemniscati <lemniscati>
Thu Jan 27 04:49:37 2022, comment #84:

Well I was also thinking of offering you the co-maintainership of this project. Just in case something is reported about this patch I can assign those bug-reports to both of us to have your inputs in the development. (Obviously if you are interested.)

निरंजन <niruvt>
Project Administrator
Thu Jan 27 04:41:47 2022, comment #83:

Thanks for pointing the problem case (again). Actually I had developed everything to fix that problem case, but I added a wrong counter number because of which the behavior didn't change. Sorry for that. On line number 556 it should have been counter number 2 and I mistakenly kept it 3. Now it is fixed and you will be prompted with the following warning.

The correct(ed) sty is attached with the patch.

I have changed the name of the counter too. It is now tipauni@settings. I hope it's safe.

> Honestly speaking, I'm getting tired of checking compiicated codes.


I am so sorry to hear that. I apologize if I have bored you in any manner.

> But practically, I doubt the necessity of taking care of them too much at the expense of too much simplicity of the codes, because absurd cases are just absurd. (Just in my opinion)


It's not just the fun or the pleasure for which I developed these features. I strongly believe that there can be situations where this would indeed be needed. e.g.

Users might just have one main document file with several tex files as \input. They might use commands like \PassOptionsToPackage{foo}{tipauni} in each of the files. If these \input files are shared with someone else and they used them in their main document without thinking of the implications (and trust me; humans do these things :P) our so called absurd situations might turn into real cases!! So please don't be pessimistic about your contributions. As I said they are really valuable.

Apart from this, if you are really bored of all of this, you are free to stop this discussion :)

(file #477, file #478)

निरंजन <niruvt>
Project Administrator
Wed Jan 26 22:58:28 2022, comment #82:

By the way, I don't know the current rules which you intend to adopt. (Sorry. I'm lost)

I guess, describing all of them explicitly will be useful to check the behaviors of the packages.

(But again, the simpler the rules are, the easier it is to check them. In my opinion.)

Lemures Lemniscati <lemniscati>
Wed Jan 26 22:48:43 2022, comment #81:

It looks okay, but not confirmed that there is no more contradiction.

The name `specialsettings' of the counter could conflict easily.
It looks a rather general word.
It can be used without \makeatletter.
It might be used another package of yours, if any.

The codes seem to become more complicated, since five internal parameters are used just for two options.

Now, the less the messages are, the less the possibily of contradictions. So the changes must be good from this point of view.

Honestly speaking, I'm getting tired of checking compiicated codes.

All I have done is just to pick some contradictions, not to prove the correctness of the codes.

I'm happy to hear that my comments have contributed to your fun.

But practically, I doubt the necessity of taking care of them too much at the expense of too much simplicity of the codes, because absurd cases are just absurd. (Just in my opinion)

Lemures Lemniscati <lemniscati>
Wed Jan 26 22:42:41 2022, comment #80:

In the case of comment #73, Fixed. no contradiction.

In the case of comment #74, Kept unchanged (no contradiction).
But the last documentfont with a empty value brings no warning (I don't know whether it is intended or not).

In the case of comment #75, Fixed. no contradiction.

Lemures Lemniscati <lemniscati>
Wed Jan 26 17:17:19 2022, comment #79:

Sorry for a delayed response, but these situations were really tricky. I had to change my approach a bit to form the current version of the package. I hope that it takes care of all the points you have so far mentioned. Even the readable version is too long to be posted now XD

I have attached the patch and a derived .sty directly in this mail. Kindly test and let me know.

PS: I loved coding this part. Thanks a ton for providing me with such a variety of absurdity. I am eager to document all of this, I am sure it would be a lot of fun :)

(file #475, file #476)

निरंजन <niruvt>
Project Administrator
Wed Jan 26 02:02:14 2022, comment #78:

Sorry for a corrupted format.

Lemures Lemniscati <lemniscati>
Wed Jan 26 02:01:10 2022, comment #77:

To be more precise, `unless otherwise specified later' is added to the first three cases, and `regarded as not specifying anything' is added to the other case. `

  1. A recommendedfont option: do `\setmainfont{CharisSIL}' unless otherwise specified later.
  2. A preservefont option: skip doing `\setmainfont' unless otherwise specified later.
  3. A documentfont option with a nonempty value: do `\setmainfont' with its

value unless otherwise specified later.

  1. A documentfont option with an empty value: be just ignored and regarded as not specifying anything, and output an descriptive warning like this (but too long):

The `documentfont' option has no value, and it is just ignored.
1. Use `preservefont', when you want the mainfont kept untouched.
2. Use `recommendedfont', when you want the mainfont set to the font
recommended by the package (i.e. CharisSIL).
3. Use `documentfont' with a font-name, when you want the mainfont set to
the font. E.g., `documentfont=CharisSIL', `documentfont=DoulosSIL',
`documentfont=DejaVuSans', etc.

Lemures Lemniscati <lemniscati>
Tue Jan 25 11:45:36 2022, comment #76:

Hi!

When I think again, it suddenly comes up to mind that you might want an option to set the mainfont to the font which is recommended by the package (i.e., CharisSIL).

Under this assumption, another solution might be:

  1. A recommendedfont option: do `\setmainfont{CharisSIL}'
  2. A preservefont option: skip doing `\setmainfont'.
  3. A documentfont option with a nonempty value: do `\setmainfont' with its value.
  4. A documentfont option with an empty value: be just ignored except outputting an descriptive warning like this (but too long):

The `documentfont' option has no value, and it is just ignored.
1. Use `preservefont', when you want the mainfont kept untouched.
2. Use `recommendedfont', when you want the mainfont set to the font recommended by the package (i.e. CharisSIL).
3. Use `documentfont' with a font-name, when you want the mainfont set to the font. E.g., `documentfont=CharisSIL', `documentfont=DoulosSIL', `documentfont=DejaVuSans', etc.

Please, note that, in this solution, an empty documentfont is just ignored, and does not favor any behavior.

Lemures Lemniscati <lemniscati>
Mon Jan 24 10:08:00 2022, comment #75:

One more example :),

A sample code to be processed with file #474:

A log contains:

Lemures Lemniscati <lemniscati>
Mon Jan 24 10:01:33 2022, comment #74:

Another absurd case which I don't know if it is intended or not.

A log contains no warning:

Lemures Lemniscati <lemniscati>
Mon Jan 24 09:24:31 2022, comment #73:

All right.
Then, another case...
A sample code to be processed with file #474:

A log contains:

Lemures Lemniscati <lemniscati>
Mon Jan 24 07:43:29 2022, comment #72:

It was not just a matter of wrong warning. In fact it was actually a bug and worth the attention. The reason being there are two real cases when the documentfont option is used without a value. 1) It being loaded with the preservefont option and 2) without it. In the first case LMR is supposed to be used as we avoid executing setmainfont whereas in the second case the Charis SIL is supposed to be used as the setmainfont must be executed in such a case. With the code so far unconditionally we were loading Charis SIL which I realized was wrong. In the attached patch new settings have been added. I hope the contradiction you spotted goes away automatically.

Without such a rigorous checking I wonder whether so intricate options would have ever been developed in tipauni! Thanks a ton.

(file #474)

निरंजन <niruvt>
Project Administrator
Sun Jan 23 22:47:52 2022, comment #71:

But I doubt the necessity to take care of an empty `documentfont` so subltely, since it is absurd by itself.

The definition of an emtpy `documentfont' will be more simple,
if it is independent of \preservefonttrue and \preservefontfalse.

Just in my lazy opinion
(although I know this is a modification of the design).

Lemures Lemniscati <lemniscati>
Sun Jan 23 21:52:21 2022, comment #70:

Now, with the code in Comment #69, this case issues a contradictory warning.

A log contains:

Lemures Lemniscati <lemniscati>
Sun Jan 23 16:25:42 2022, comment #69:

Thanks for the correction. I forgot to add \charissil true in one of the if conditionals. Corrected now. Also I have edited the warning message and written (Xe/Lua)LaTeX instead of just LaTeX. Commas are added now.

निरंजन <niruvt>
Project Administrator
Sun Jan 23 15:59:53 2022, comment #68:

By processing this with file #473:

I've got a log containing this:

The result is typeset with Latin Modern, contradicting to the warning message which says typesetting with Charis SIL.

Lemures Lemniscati <lemniscati>
Sun Jan 23 15:07:20 2022, comment #67:

Thank you. The readable format is helpful.

I doubt this part of the message:

the default font-family of LaTeX i.e. Latin Modern

It seems true for LuaLaTeX and XeLaTeX.
But, it's not true for LaTeX, obviously.
So, I feel very uneasy...

`i.e.' in this case might need commas before and after it.

`tipauni-external' seems a newly coined word, although it is understandable.

Lemures Lemniscati <lemniscati>
Sun Jan 23 13:57:45 2022, comment #66:

Here is something better:

The code is already there in the patch. Giving it here in a readable format if you are bored of constant merging :P

With the following code:

I get:

and with:

I get:

(file #473)

निरंजन <niruvt>
Project Administrator
Sat Jan 22 23:06:19 2022, comment #65:

Another example would be better "Keeping the current setting for font (and font features)".

Lemures Lemniscati <lemniscati>
Sat Jan 22 22:54:25 2022, comment #64:

`preservefont' is just for avoiding \setmainfont, and not for loading delault LaTeX font.

In my opinion, modifying the warning message will suffice.
e.g. "Skipping \setmainfont." in the message.

I'm too lazy to hack LaTeX internals for taking care of rather absurd settings, although I'm too obsessive about absurdity... ;).

There is a typo in the patch:

I didn't test it yet (sorry).

Lemures Lemniscati <lemniscati>
Sat Jan 22 18:12:06 2022, comment #63:

I must admire your skills at creating such tricky situations! I am stuck here. I understand the problem, but I am not sure how to tackle it. Because, if we test \ifx\f@family\@empty, it also involves cases of earlier successful loading of documentfont. e.g.

Or even preservefont which defaults to LMR.

So I don't know how to proceed further.

(file #472)

निरंजन <niruvt>
Project Administrator
Sat Jan 22 01:46:26 2022, comment #62:
Lemures Lemniscati <lemniscati>
Sat Jan 22 01:45:18 2022, comment #61:
Lemures Lemniscati <lemniscati>
Sat Jan 22 01:42:53 2022, comment #60:

I think it's ok.

But, it seems necessary to comfirm that warnings are appropriate.

Lemures Lemniscati <lemniscati>
Fri Jan 21 15:10:11 2022, comment #59:

Cool!

So are we good to go with the current design?

निरंजन <niruvt>
Project Administrator
Fri Jan 21 14:42:15 2022, comment #58:

I see.

Honestly speaking, the `preservefont' option suffices for my use as such (because fontspec commands suffice to control fonts):
+vetbatim+
\documentclass{article}
\usepackage[preservefont]{tipauni}
\begin{document}

\setfontfamily{\ipafamily}{CharisSIL}[Scale=.9]

International Phonetic Association
{\ipafamily [ɪntəˈnæʃənəl fəˈnɛtɪk əsoʊsiˈeɪʃn]}

\setfontfamily{\ipafamily}{DoulosSIL}

International Phonetic Association
{\ipafamily [ɪntəˈnæʃənəl fəˈnɛtɪk əsoʊsiˈeɪʃn]}

\setfontfamily{\ipafamily}{DejaVuSans}[Scale=.8]

International Phonetic Association
{\ipafamily [ɪntəˈnæʃənəl fəˈnɛtɪk əsoʊsiˈeɪʃn]}

\end{document}
-verbatim-

Lemures Lemniscati <lemniscati>
Fri Jan 21 12:20:10 2022, comment #57:

> I guess what I expect from preservefont might be called preservefontandfontspecoptions or preservefontandfontfeatures from your viewpoint.


Correct!

> Although the name of the command `\setmainfont' contains neither `options' nor `features', the command treats font features as a option (treating font features as empty even if not specified).


Yes, I agree with this, but it is a command from package fontspec. The distinction I am trying to draw here between preservefont and fontspecoptions is of that package only. preservefont doesn't use package fontspec at all as it doesn't load any font. If that is the case, my names are already very intuitive. If you want I can make it something like preserveltxfont or nofontspec for example.

निरंजन <niruvt>
Project Administrator
Fri Jan 21 12:11:53 2022, comment #56:

I've not got your point yet.

I guess what I expect from preservefont might be called preservefontandfontspecoptions or preservefontandfontfeatures from your viewpoint.

Although the name of the command `\setmainfont' contains neither `options' nor `features', the command treats font features as a option (treating font features as empty even if not specified).

So it would make sense that the concept of `font' contains both of `font' and `font features'. (Just in my opinion)

Lemures Lemniscati <lemniscati>
Fri Jan 21 11:13:44 2022, comment #55:

In this case also I feel the names themselves shall trigger the warning. I could have said 'fontoptions', but I deliberately said `fontspecoptions'. The reason why your case won't produce what you are expecting is you are simply not using anything given by fontspec.

निरंजन <niruvt>
Project Administrator
Fri Jan 21 11:10:09 2022, comment #54:

All right.

But, knowing that preservefont does not cancel fontspecoptions,
someone (like me) might expect:

Lemures Lemniscati <lemniscati>
Fri Jan 21 10:13:50 2022, comment #53:

I feel adding a warning in this case is unnecessary. With so specific names for the options such as preservefont and fontspec*options, I believe it is fundamentally wrong to even think that preservefont might cancel the fontspecoptions. I feel looking at the results even the names themselves shall trigger a warning to the user. Adding an actual warning would be to noisy in my opinion.

I assure you that I will describe these options well in the documentation.

निरंजन <niruvt>
Project Administrator
Fri Jan 21 10:04:15 2022, comment #52:

Is file #471 is an incomplete fix for comment #50?
Or, an objection to the warning?

Lemures Lemniscati <lemniscati>
Fri Jan 21 06:04:33 2022, comment #51:

Kindly ignore file 470 and use the following patch.

(file #471)

निरंजन <niruvt>
Project Administrator
Thu Jan 20 21:00:56 2022, comment #50:

Is it an intentional modification, the difference between the results of file #464 and file #465?

My expectation is currently based on the former one.

Lemures Lemniscati <lemniscati>
Thu Jan 20 19:43:47 2022, comment #49:

A similar case in the comment #48:

Lemures Lemniscati <lemniscati>
Thu Jan 20 19:25:02 2022, comment #48:
Lemures Lemniscati <lemniscati>
Thu Jan 20 13:42:34 2022, comment #47:

Thanks for pointing this case! Fixed.

(file #467)

निरंजन <niruvt>
Project Administrator
Thu Jan 20 13:07:10 2022, comment #46:
Lemures Lemniscati <lemniscati>
Thu Jan 20 12:30:32 2022, comment #45:

Fixed!

Anything else?

(file #466)

निरंजन <niruvt>
Project Administrator
Thu Jan 20 12:14:18 2022, comment #44:

Reposting #43
But in this case, I think the warning about `fontspecoptions' can be omitted to avoid bothering.

Lemures Lemniscati <lemniscati>
Thu Jan 20 12:07:36 2022, comment #43:

But in this case, I think the warning about `fontspecoptions' can be omitted to avoid bothering.

Lemures Lemniscati <lemniscati>
Thu Jan 20 12:03:49 2022, comment #42:

Thank you!

Yes, I expect that warning in the case of comment #41.

Lemures Lemniscati <lemniscati>
Thu Jan 20 11:48:11 2022, comment #41:

If I understand you correctly,

This is the case you are talking about, but with the latest code, this indeed throws a warning. The warning message is as follows:

Can you demonstrate with code the situations in your mind and tell me which warning messages you expect there?

निरंजन <niruvt>
Project Administrator
Thu Jan 20 11:20:52 2022, comment #40:

As in comment #31

In my obsessive opinion :),

I wish warnings would be useful in order to fill a gap between misunderstangings and the correct understanding.

That is,

Warnings will be useful for such people like me who might incorrectly expect some of the following rules when the result and their expectations are different:

  1. preservefont would override itself, documentfont, and fontspecoptions (and also resetfontspecoptions),
  2. documentfont would override itself and preservefont,
  3. fontspecoptions and resetfontspecoptions would override themselves only,
  4. fontspecoptions and resetfontspecoptions would override themselves and preservefont.

But I think also, in cases the result and incorrect expectations are same, it is ok to suppress the warning to avoid bothering.

This is just a personal wish.

Sorry for abstract explanations.

I know it is bothering to reckon such absurd cases.

Lemures Lemniscati <lemniscati>
Wed Jan 19 19:52:15 2022, comment #39:

Oh sorry I meant "[...] a simple warning message along with loading Charis SIL [..]".

निरंजन <niruvt>
Project Administrator
Wed Jan 19 19:49:03 2022, comment #38:

While thinking about the case you mentioned I realized that Charis SIL is also getting loaded with fontspec. So if nothing else, the options must be executed with the Charis SIL font. In fact that can be a valid requirement too. i.e. to add certain features to the default font Charis SIL. Hence I have changed the working of the program and made it a bit simpler. If a font is loaded with documentfont and has the highest priority, then the fontspecoptions are added to that font. If this option is not used, we have made sure that the Charis SIL gets loaded, thus the fontspecoptions will be used for it.

There is only one condition when both the Charis SIL and the documentfont are inactive. It is when the preservefont option is loaded. I have issued the warning when the preservefont option is used with fontspecoptions and there is no host added later on for those options with documentfont. Thus I assume that the case you were describing itself must have vanished now. Right?

Also, sorry! I have started feeling that even though documentfont= is faulty, it's not error-worthy. A simple error message along with loading Charis SIL should suffice. Please see the patch for reference. In case it is too difficult to read from the patch or merge the patch (as there are a lot in queue) here is a plain text readable version of the latest relevant code.

(file #465)

निरंजन <niruvt>
Project Administrator
Wed Jan 19 12:46:35 2022, comment #37:

All right. I see.

By the way, what about the second type of warning which I suggest in the comment #31.
Do you mind adopting it?

This will bring a warning in cases like the one in comment #26.
But the case in comment #26 is rather absurd (containing unnecessary `preservefont'), so ordinary users will not be bothered by this warning.

Lemures Lemniscati <lemniscati>
Wed Jan 19 12:29:16 2022, comment #36:

As a software user and developer I feel a manual consists of the explanation of how and why the code works the way it works and warnings just pinpoint some small problems with a little explanation of why these problems arose at the first place. I think with this logic my current error message suits the purpose. At least to me it doesn't look a manual-like message.

I wouldn't want to shorten it further for a subjective opinion, but I would definitely consider editing it for some concrete objective points like I did in my last message.

निरंजन <niruvt>
Project Administrator
Wed Jan 19 12:24:17 2022, comment #35:

From a viewpoint of me as a user, the warning message is rather long to get the point. It looks like a detailed explanation in a manual.

I guess, it would be helpful for users that warning messages are concise and explicit about the cause of warning.
And a phrase like `See the manual for details.' might be useful in a warning message in order to make the user read the manual :).

And, I admit my first warning message is also too long, from this point of view.

Lemures Lemniscati <lemniscati>
Wed Jan 19 03:14:10 2022, comment #34:

> Please tell me a particular case.
> With the patch file #463, no warning is issued in this case:


I am sorry, that was my bad. It was something that I added to the code which was giving that warning. I believed it to be a problem in your patch, but it wasn't.

> And preservefont makes documentfont ineffective and keep its fontname, i.e. preservefont does not totally clear documentfont.


Correct! Thanks for this correction. Now the warning message is as follows.

निरंजन <niruvt>
Project Administrator
Tue Jan 18 22:26:03 2022, comment #33:

Thank you for checking my patch.


> Control sequences in your patch had rather complicated names, which I changed for the maintenance's convenience.


I agree, Thank you.


> Your patch issued warnings with simple usages of `documentfont' too, which might be a bit too noisy for some users


Please tell me a particular case.

With the patch file #463, no warning is issued in this case:


The first sentence of the new warning message in file #464
looks too complicated for me.

And preservefont makes documentfont ineffective and keep its fontname, i.e. preservefont does not totally clear documentfont.

Lemures Lemniscati <lemniscati>
Tue Jan 18 18:13:58 2022, comment #32:

Thanks a lot for suggesting an algorithm and also providing a patch for the same. It helped me a lot!

I have changed bits of your patch to form a version that looked best to me. Let's put it to review.

Control sequences in your patch had rather complicated names, which I changed for the maintenance's convenience. Your patch issued warnings with simple usages of `documentfont' too, which might be a bit too noisy for some users, so I prefer avoiding them. I have enhanced the other warning message which I found very necessary in such a way that the user would understand the usage of the package options properly and won't get confused. Please try the following example with the attached patch to see the changed warning message.

I hope this change looks good to you. I apologize for editing your patch so much that it is almost unrecognizable to you now, but even if I have edited it so much, I must say that it has helped me a lot for developing a much needed functionality.

On a lighter note, just a small remark on your coding style.

The % sign issued at the EOL in LaTeX definitions is to avoid the additional space. e.g. Try the following:

Which means, there is no need to add a % after a control sequence. It automatically eats up one as a general rule in TeX and friends. Therefore \correctfoobar doesn't is typeset as foobardoesn't in the output. I have removed all the % signs which were added in your patch after control sequences :)

(file #464)

निरंजन <niruvt>
Project Administrator
Tue Jan 18 14:03:47 2022, comment #31:

I think the reason why I want warnings, again.

Warnings will be useful for such people like me who might think that preservefont would override both of documentfont and fontspecoptions although it overrides documentfont only.

From this point of view, I guess the case of Comment #26 needs a warning.

So, I add another warning for cases like this.

(file #463)

Lemures Lemniscati <lemniscati>
Tue Jan 18 12:09:01 2022, comment #30:

This warning message would be better than file #462:

Lemures Lemniscati <lemniscati>
Tue Jan 18 11:49:56 2022, comment #29:

Please try the patch file #462, which is to be applied after the patch file #461.

Lemures Lemniscati <lemniscati>
Mon Jan 17 21:53:27 2022, comment #28:

I've forgotten to append this:

6. resetfontspecoptions sets \@tipauni@warning@false.

Lemures Lemniscati <lemniscati>
Mon Jan 17 21:40:47 2022, comment #27:

A warning might be helpful when the following \if is true at the end of options.

Sorry for too long name. It can be another appropriate name.

Assume this \if is named as \if@tipauni@warning@ (just for short), for the time being.

The following algorithm is a suggestion.

How to set this \if@tipauni@warning@:

  1. At the beginning, set \@tipauni@warning@false.
  2. preservefont and documentfont set \@tipauni@warning@false.
  3. fontspecoptions with an empty value sets. \@tipauni@warning@false.
  4. fontspecoptions with a nonempty value while \iffontpreservation is false, then set \@tipauni@warning@false.
  5. fontspecoptions with a nonempty value while \iffontpreservation is true, then set \@tipauni@warning@true.

And output a warning \if@tipauni@warning@:

Lemures Lemniscati <lemniscati>
Mon Jan 17 17:22:21 2022, comment #26:

Welcome :)

Comments on your points:

1. I have tried and failed implementing this requirement. I wouldn't mind adding such a functionality, but I am not able to develop it. The situations where my attempts failed included something like following (well, it seems I have also developed the ability of constructing absurd situations XD):

When preservefont is followed by a documentfont, if I set the check with \iffontpreservation, it fails as documentfont sets fontpreservation to false. Since the warning has already been generated when the preservefont was loaded, it doesn't stop when a documentfont is loaded and the fontspecoptions are in fact active! I tried various approaches to stop this behavior only to disappointment myself. Maybe I can't add this functionality at the moment, but if you have any ideas, they are always welcome.

2. Well, it might be called as an alias, but not everyone might be able to think like, "oh let's try passing an empty value to fontspecoptions" :P So they might make use of it.

3. As I had already mentioned, I would like to stay with the \newif approach.

Anything else required? Any suggestions?

निरंजन <niruvt>
Project Administrator
Mon Jan 17 11:27:17 2022, comment #25:

I feel it is better. Thank you.

Other points:

  1. People like me might be puzzled when preservefont is effective and fontspecoptions is not empty since fontspections is silently ignored. So, I think it is helpful to output a warning through \PackageWarning in such cases.
  2. resetfontspecoptions might be unnecessary because it is just an alias of 'fontspecoptions' (without a value) or 'fontspecoptions=' (with an empty value).
  3. Since \ifnocharis is false if and only if \tipauni@font is empty, \ifnocharisfalse (and \newif\ifnocharis, which sets \ifnocharisfalse) can be replaced by \let\tipauni@font\tipauni@font@default while \tipauni@font@default is defined as \def\tipauni@font@default{CharisSIL} earlier. (Just in my opinion. I know it depends on preference about coding.)
Lemures Lemniscati <lemniscati>
Sun Jan 16 18:43:54 2022, comment #24:

Clever points!!

Few comments:

The job of the package option preservefonts is to forget loading some other font entirely. Expecting that it would also forget the font options would be then weird, but I understand the requirement and hence I provide a new option to reset font options. I have also renamed the options for more clarity.

Please see the patch and the following code with three new cases.

(file #461)

निरंजन <niruvt>
Project Administrator
Sun Jan 16 07:17:05 2022, comment #23:

Thank you, निरंजन!

It looks good to me about documentfont and preservefont options. Thank you again for accepting my wish.

However, when it comes to adding fontoptions, it seems complicated.

I know I'm too obsessive about absurd situations, but human beings can do absurd things. So, I add a few cases to be considered.

Among them, two cases (marked with `!!!' below) bring different results from my expectations.

Lemures Lemniscati <lemniscati>
Sat Jan 15 16:31:49 2022, comment #22:

After a thorough discussion on emails with Jonathan Spratte, a LaTeX expert who has heavily contributed in the development of tipauni, I have decided to go with the following approach. I believe that the attached patch shall definitely fulfill all your desires. Try this MWE:

Please review the and let me know if you still feel anything is missing or wrong. Don't hesitate and don't feel sorry for your rigorous feedback. I must acknowledge that it has helped tipauni's development a lot! :)

(file #460)

निरंजन <niruvt>
Project Administrator
Fri Jan 14 12:38:46 2022, comment #21:

Thank you for struggling with my wish.

But, I'm afraid that a mixture of documentfont and fontoptions options would be too complicated...


I think that DoulosSIL or DejaVu Sans could be other candidates besides CharisSIL.


By the way, ...

What if there is a macro which checks whether a font contains all the IPA characters?

What if tipauni package outputs a warning if the macro fails, so that authors can know the failure through logs (as a default, this check would be done in \AtEndOfPreamble or \AtBeginDocument, or at the time of loading tipauni package)?

Lemures Lemniscati <lemniscati>
Fri Jan 14 08:43:06 2022, comment #20:

I am sorry, the code I posted here probably has a few bugs, please give me some time to work on it and provide something better. I have gone through your patches, but maybe I would like to take a different approach in the code. I will come back with something better.

निरंजन <niruvt>
Project Administrator
Thu Jan 13 19:18:22 2022, comment #19:

I think the following code should solve most of your complaints plus add another functionality to add options to the font being selected:

Loading Charis SIL is a very necessary step. Merely rendering IPA in Unicode doesn't mean anything to a common user. If they can't see the output, it's almost useless for them. The Latin Modern font doesn't have a lot of IPA characters. The Computer Modern Unicode has most of them, but still there are some characters missing and some characters have weird shapes. Hence loading a perfect Unicode font was necessary and therefore I selected CharisSIL.

Please don't feel sorry for reporting your opinions and suggestions. They are much valued! :-)

निरंजन <niruvt>
Project Administrator
Thu Jan 13 13:08:00 2022, comment #18:

Sorry for bothering.

I've noticed that the documentfont option is unnecessary in the first place, because it is currently equivalent to \setmainfont.

And, apart from backward compatibility, once the unconditional \setmainfont{CharisSIL} is removed, the preservefont option is also unnecessary.

It is just my personal opinion...
But, I guess it's not absurd.

Regards,

Lemures Lemniscati <lemniscati>
Wed Jan 12 21:41:19 2022, comment #17:

Anothoer choice might be removal of \setmainfont{CharisSIL},
because there is no meaning about changing fonts in the text \usepackage{tipauni}.

This is a very simple change.
And each documentfont option executes \setmainfont immediately.
Although it causes a backward compatibiliy issue, it seems semantically correct.

Does this make sense?

I apologize for posting many times.

Thank you for developing the package!

Lemures Lemniscati <lemniscati>
Wed Jan 12 11:26:28 2022, comment #16:

I apologize repeated posts.
My explanation was very awkward.

Let me rephrase it.

When we consider introducing preservefont, it means that we also consider changing the default settings about \setmainfont and the role of documentfont.

The originai behavior is this:

  1. The default state is that \setmainfont{CharisSIL} is executed immediately.
  2. When a documentfont option is set, \setmainfont is executed with the option's value.

By introducing preservefont option, the default setting is expected to be like this:

  • \setmainfont{CharisSIL} is executed, if neither documentfont nor preservefont is specified later.

If this rephrasing is acceptable, we would proceed futher.

And then, it seems natural that a documentfont option changes the setting like this:

  • \setmainfont is executed with the option's value, if neither documentfont nor preservefont is specified later.

Finally, it also seems natural that a preservefont changes the setting like this:

  • No \setmainfont is executed, if neither documentfont nor preservefont is specified later.

Addtionally, documentfont with an empty value should cause an error.

This is what the patch (file #457) will implement.

Regards,

Lemures Lemniscati <lemniscati>
Tue Jan 11 14:13:38 2022, comment #15:

A patch for fix (comment #14) is uploaded as file #457.
It can be applied to the commit aadf596abb3f0a0a3203de51a94cbce765cd151e.

Regards,

Lemures Lemniscati <lemniscati>
Tue Jan 11 11:50:25 2022, comment #14:

Is it acceptable as an improvement after the patch file #450,
if these changes are done?

  1. documentfont= should bring an error.
  2. preservefont behaves as if documentfont= (but don't bring an error).

Regards,

Lemures Lemniscati <lemniscati>
Tue Jan 11 11:42:15 2022, comment #13:

I think I've understand it.

My wishes are:

  1. documentfont and preservefont have same priority.

and

  1. When a documentfont has the highest priority, do \setmainfont with its value, and ignore all the other documentfont and preservefont.
  2. When a preservefont has the highest priority, skip doing \setmainfont, and ignore all the other documentfont and preservefont.
  3. Neither documentfont nor preservefont has specified, do as if documentfont=CharisSIL is specified.
Lemures Lemniscati <lemniscati>
Tue Jan 11 11:21:25 2022, comment #12:

I am also new to this format :).

The page https://savannah.gnu.org/markup-test.php seems a good guide to it.

Lemures Lemniscati <lemniscati>
Tue Jan 11 10:53:57 2022, comment #11:

Pardon the weird formatting.

I am also learning this new markdown syntax.

निरंजन <niruvt>
Project Administrator
Tue Jan 11 10:50:54 2022, comment #10:

The problem is their meanings.

I consider meanings of commands very important.

When I say *documentfont, meaning wise it expects a name of the font. Keeping this option blank doesn't mean anything. When I say preservefont* it is self-sufficient. It knows what it needs to do. I would want to avoid semantically anomalous commands in my code.

निरंजन <niruvt>
Project Administrator
Tue Jan 11 10:25:18 2022, comment #9:

By the way, what is the problem about the solution by the file #450.

In this solution, it uses only one concept documentfont. And it is very simple:

  1. As a default, \tipauni@font is CharisSIL.
  2. A documentfont option sets its value to \tipauni@font.
  3. If \tipauni@font is non-empty, do \setmainfont with it.
  4. Otherwise, skip doing \setmainfont.

So, I guess, it is unnecessary to create a new option preservefont, in fact, when patched by the file #450.

But, I don't hate defining an alias of documentfont= (documentfont option with an empty value).

Regards,

Lemures Lemniscati <lemniscati>
Tue Jan 11 02:49:20 2022, comment #8:

In your example, case number (1) and (3) are desirable to me. Do you have any complaints regarding them? If yes what are they?

I believe that you are unhappy with case number (2), but I think we are conceptually not on the same page with the option preservefont. The only motivation for developing the option preservefont, is to stop package tipauni from making Charis SIL the default font. It doesn't (for me at least) mean to reset the font. If a person strongly wants to override all the font definitions and use Latin Modern only, then maybe I can develop a third option named resetfont which will reset the font to Latin Modern with

The user can then issue

to ensure that every other font is disabled and defaulted back to Latin Modern. Is this what you want?

Essentially what I want to say is preservefont means something different to you than what it means to me.

निरंजन <niruvt>
Project Administrator
Mon Jan 10 21:19:29 2022, comment #7:

In short, although `documentfont` can be overridden by another `documentfont`, `documentfont` cannot be overriden by `preservefont`.

I feel these situations are confusing (I know the absurdity):

(1) `\usepackage{documentfont=foo,documentfont=bar}{tipauni}`

`documentfont=bar` is effective.

(2) `\usepackage{documentfont=foo,preservefont}{tipauni}`

`documentfont=foo` is effective.

(3) `\usepackage{preservefont,documentfont=foo}{tipauni}`

`documentfont=foo` is effective.

Lemures Lemniscati <lemniscati>
Mon Jan 10 21:06:33 2022, comment #6:

I would like to know the reason why overriding options should be prevented.

---

I agree that this is absurd:

```
\usepackage{documentfont=foo,preservefont}{tipauni}
```

But it can happen.

Assume that we use a file `common.tex` as a personal common settings, and in files `main1.tex`, `main2.tex`, ... (multiple documents),

```
\input{common.tex}
\usepackage{tipauni}
````

Assume futher that, in files `OtherMain1.tex`, `OtherMain2.tex`, ... (another series of documents), `othersettting.tex` is used for additonal settings.

```

\input{common.tex}
\input{othersettings.tex}
\usepackage{tipauni}
````

In such a case, when we set like this

common.tex:
```
\PassOptionsToPackage{documentfont=DoulosSIL}{tipauni}
```

othersettings.tex:
```
\PassOptionsToPackage{documentfont=OtherFont}{tipauni}
```

the option `documentfont=OtherFont` overrides `documentfont=DoulosSIL`

On the other hand, when we set like this

common.tex:
```
\PassOptionsToPackage{documentfont=DoulosSIL}{tipauni}
```

othersettings.tex:
```
\PassOptionsToPackage{preservefont}{tipauni}
```

the option `preservefont` does not override `documentfont=DoulosSIL`.

I feel these situations is very confusing.

Lemures Lemniscati <lemniscati>
Mon Jan 10 17:06:45 2022, comment #5:

If I am not mistaken,

is equivalent to

So by this logic, why would someone ever want to use something like this?

The purpose of these two options is completely contradictory, isn't it?

निरंजन <niruvt>
Project Administrator
Mon Jan 10 13:22:43 2022, comment #4:

It looks almost okay to me...

But I wonder a case:

\PassOptionsToPackage{documentfont=DoulosSIL}{tipauni}
%% ...
%% ...
%% ...
%% ...
\usepackage[preservefont]{tipauni}

in which 'preservefont' cannnot cancel 'documentfont'.


For example, after applying file #450, add a line like this.

\DeclareOptionX{preservefont}{\def\tipauni@font{}}

And I guess the documentfont option can be cancelled by preservefont option.

I prefer delayed evaluation of options (just in my opinion).

Regards,

Lemures Lemniscati <lemniscati>
Mon Jan 10 11:45:25 2022, comment #3:

Correct, so what about this?

(file #456)

निरंजन <niruvt>
Project Administrator
Mon Jan 10 11:32:46 2022, comment #2:

Thank you for considering the feature.
The explicit option 'preservefont' is favorable to me.

Still, when we write this (even if patched by the file #455):

\usepackage[documentfont=DoulosSIL]{tipauni}

LaTeX will process both of these two lines:

\setmainfont{CharisSIL}
\setmainfont{DoulosSIL}

And, in this case, I think the call of \setmainfont{CharisSIL} is redundant.

Regards,

Lemures Lemniscati <lemniscati>
Mon Jan 10 10:42:03 2022, comment #1:

Won't this be better?

(file #455)

निरंजन <niruvt>
Project Administrator
Sat Jan 8 22:55:51 2022, original submission:

\setmainfont{CharisSIL} is executed even when we specified as follows:

\usepackage[documentfont=DoulosSIL]{tipauni}

The first patch attached should fix this.
As an additional feature, when 'documentfont=' (an empty value),
the default font for the entire document is unchanged.

The second patch attached should add comments on the new feature.

Lemures Lemniscati <lemniscati>

 

Attached Files
file #487:  tipauni.sty added by niruvt (27kB - text/x-tex)
file #477:  tipauni.sty added by niruvt (27kB - text/x-tex)
file #475:  tipauni.sty added by niruvt (27kB - text/x-tex)
file #474:  0013-charis-and-lmr.patch added by niruvt (2kB - text/x-patch)
file #473:  0012-better-warnings.patch added by niruvt (2kB - text/x-patch)
file #471:  0010-fix-comment-50.patch added by niruvt (804B - text/x-patch)
file #468:  0008-fix-comment-48.patch added by niruvt (1kB - text/x-patch)
file #469:  0009-fix-comment-49.patch added by niruvt (2kB - text/x-patch)
file #470:  0010-fix-comment-50.patch added by niruvt (56kB - text/x-patch)
file #467:  0007-fix-error.patch added by niruvt (814B - text/x-patch)
file #463:  Add-warnings-about-fontspecoptions.patch added by lemniscati (5kB - application/octet-stream - To be applied after the patch file #461: Add warnings about fontspecoptions)
file #462:  0002-Add-a-warning-about-fontspecoptions.patch added by lemniscati (2kB - application/octet-stream - To be applied after the patch file #461: Add a warning about fontspecoptions)
file #461:  0001-font-options.patch added by niruvt (2kB - text/x-patch)
file #460:  0001-fonts.patch added by niruvt (2kB - text/x-patch)
file #457:  0001-Avoid-unconditional-loading-of-CharisSIL-and-add-pre.patch added by lemniscati (2kB - application/octet-stream - A patch for the commit aadf596abb3f0a0a3203de51a94cbce765cd151e)
file #456:  0001-preserve-fonts.patch added by niruvt (1kB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by niruvt (Updated the item)
  • -unavailable- added by lemniscati (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    25 latest changes follow.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon Feb 21 05:12:19 2022niruvtOpen/ClosedOpen=>Closed
    Sun Jan 30 06:29:36 2022niruvtAttached File-=>Added 0019-fix-loading-charis-sil.patch, #488
    Sat Jan 29 17:39:19 2022niruvtAttached File-=>Added 0017-add-an-option-and-correct-one.patch, #485
      Attached File-=>Added 0018-correct-a-warning-message.patch, #486
      Attached File-=>Added tipauni.sty, #487
    Fri Jan 28 03:18:45 2022niruvtAttached File-=>Added 0015-change-the-value-of-a-counter.patch, #479
    Thu Jan 27 04:41:47 2022niruvtAttached File-=>Added tipauni.sty, #477
      Attached File-=>Added 0016-change-the-name-of-the-counter.patch, #478
    Wed Jan 26 17:17:19 2022niruvtAttached File-=>Added tipauni.sty, #475
      Attached File-=>Added 0014-using-counters-for-conditionals.patch, #476
    Mon Jan 24 07:43:29 2022niruvtAttached File-=>Added 0013-charis-and-lmr.patch, #474
    Sun Jan 23 13:57:45 2022niruvtAttached File-=>Added 0012-better-warnings.patch, #473
    Sat Jan 22 18:12:06 2022niruvtAttached File-=>Added 0012-add-another-warning.patch, #472
    Fri Jan 21 06:04:33 2022niruvtAttached File-=>Added 0010-fix-comment-50.patch, #471
    Fri Jan 21 06:01:38 2022niruvtAttached File-=>Added 0008-fix-comment-48.patch, #468
      Attached File-=>Added 0009-fix-comment-49.patch, #469
      Attached File-=>Added 0010-fix-comment-50.patch, #470
    Thu Jan 20 13:42:34 2022niruvtAttached File-=>Added 0007-fix-error.patch, #467
    Thu Jan 20 12:30:31 2022niruvtAttached File-=>Added 0006-suppress-warning-when-options-empty.patch, #466
    Wed Jan 19 19:49:03 2022niruvtAttached File-=>Added 0005-conditional-warning.patch, #465
    Wed Jan 19 11:58:34 2022niruvtSeverity1 - Wish=>5 - Normal
      StatusNone=>Ready For Test
    Tue Jan 18 18:13:58 2022niruvtAttached File-=>Added 0004-wip-enhancing-the-warning.patch, #464
    Tue Jan 18 14:02:05 2022lemniscatiAttached File-=>Added Add-warnings-about-fontspecoptions.patch, #463
    Tue Jan 18 11:44:30 2022lemniscatiAttached File-=>Added 0002-Add-a-warning-about-fontspecoptions.patch, #462
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray