Problem is, it's a LangSet, so one can't, say, delete the "ja" lang from a font upon scan.
Thought about it again. We should add special rules for modifying a langset, like we have for matrix (multiply, etc).
Created attachment 36555 [details] [review]
Allow to modify langset and charset
This patch would allows to modify the langset and the charset by e.g.
<edit name="charset" mode="assign" binding="strong">
<edit name="lang" mode="assign" binding="strong">
After running fc-cache -f again, HanaMin becomes matching with serif:lang=ja say.
which originally is only capable for zh-hk|zh-mo|zh-tw unexpectedly.
Assigning 'ja' to charset makes no sense. Humm, oh you mean you are copying the ja.orth charset to it. I see! Interesting... Lemme poke.
Ok. This is a good start.
First, please keep FcVStackCharSet/LangSet and the respective FcVStack members in the same block as other types.
Next, the langset handling looks about right, except that we should support 1. multiple strings, 2. add, delete, etc, as opposed to plain assign.
For charset, the way you've done it is wrong. We want to be able to add/delete specific unicode characters or ranges.
Thank you for the comment. let me clean up a bit.
just filed a separate bug for charset as Bug#31969.
some code for add/remove could be re-used for langset too. FYI.
re-worked a bit based on the patch at Bug#31969:
the syntax is similar to that.
Looks good generally. Lets add FcLangSetUnion and FcLangSetSubtract and use them.
(In reply to comment #8)
> Looks good generally. Lets add FcLangSetUnion and FcLangSetSubtract and use
also added langset thing into fonts.dtd too.
Hm, it seems some garbages was slipped into commits in this branch. doh.
assuming that both editing langset and charset will be into fontconfig master, tha would be easier to do review the patch generated by "git diff master" on langset-modification-take2 branch, but anyway.
merged changes into new branch.
Added some documents:
Pushed to master. Please test. Thanks!
That works for me. thanks!