Similar to this question I want to use selnolig but I don't like the fact that in words containing fl without ligature these two letters are too close together.
Like in Mico's answer I want to use the "new" method because I found that with the font I'm using this will make perfect kerning. Unfortunately the code given in this answer provides the "new" method only for single words.
Is it possible to use this method for every word with a non-ligature fl combination? In other words: Is it possible to add a fixed kerning between all f and l letters that are automatically broken into single letters by selnolig?
Here is a minimal example (taken from Mico's answer linked above):
\documentclass[ngerman]{article}
\usepackage{fontspec}
\usepackage{selnolig}
\usepackage{luacode}
\begin{luacode}
function breaklig (s)
s = s:gsub ( 'Verzweiflung' ,
'Ver\\-zweif\\discretionary{-}{}{\\kern0.05em}lung' )
return s
end
luatexbase.add_to_callback( 'process_input_buffer' ,
breaklig , 'break ligatures in specified words' )
\end{luacode}
\begin{document}
Verzwei\uselig{fl}ung {V}erzweiflung Verzweiflung
\end{document}
- The first example uses a ligature that should not be used in this case.
- The second is the output produced by
selnoligwith the lettersfandltoo close together. - The third uses the luacode above to create a
0.05emkerning that does not interfere with TeX's hyphening algorithms (as far as I know).
I want to use the third one for all words containing fl where selnolig breaks the ligature.

selnoligbreaks ligatures by inserting whatsits which completely disables kerning. You could modifyselnoligto insert tagged whatsits and then have thelinebreak_filtercallback walk the hlist and reinsert kerning on tagged nodes. – Henri Menke Jul 20 '18 at 11:03ligaturingcallback phase (selnolig's current method) or by inserting an explicit amount of whitespace (David's method, or also thebabel-shorthand method) -- it's also important to decide what to do regarding line-breaking possibilities.selnolig's approach was chosen, in part, so as not to interfere with TeX's hyphenation algorithms. Note that David's answer (in the link you provided) potentially runs into trouble in this regard. – Mico Jul 20 '18 at 11:07discretionaryto not interfere with the hyphenation algorithms. So my questions is if one could expand your code to work with every word that usesflwith no ligature. – Erik Jul 20 '18 at 11:51