The management of kerning appears in LaTeX not so effective in the case of note numbers. A magnificent solution for footnotes has been provided by David Purton in this thread:
Now, since I have to produce an article with the notes at the end of the text, that solution does not work. Is there a way to re-adapt the code produced by David Purton to endnotes?
I enclose a MWE of the basic endnotes code, obviously without kerning.
\documentclass{article}
\usepackage{fontspec}
\usepackage[english]{babel}
\babelfont[english]{rm}[Ligatures=TeX,Numbers=Proportional,OldStyle},RawFeature=+calt]{Source Serif Pro}
\usepackage{endnotes}
\usepackage{etoolbox}
\preto{\theendnotes}{%
\renewcommand{\makeenmark}{\textsuperscript{\theenmark}\enspace}%
}
\let\footnote=\endnote
\begin{document}
text text «text»\footnote{Footnote text.}.
text text «text»\footnote{Footnote text.}.
text text «text»\footnote{Footnote text.}.
text text «text»\footnote{Footnote text.}.
text text «text»\footnote{Footnote text.}.
text text «text»\footnote{Footnote text.}.
\theendnotes
\end{document}
Thank you
ADDENDUM
A more complex test, with superscript footnotes numbers, but for bibliography:
\begin{filecontents*}{jobname.bib}
@book{ stegmuller:1976,
author = "Stegmüller, Wolfgang",
title = "The Structure and Dynamics of Theories",
publisher = "Springer",
location = "New-York Heidelberg Berlin",
year = "1976",
}
\end{filecontents*}{jobname.bib}
\documentclass[a4paper,11pt]{article}
\usepackage{fontspec}
\usepackage[english]{babel}
\babelfont[english]{rm}[Ligatures=TeX,Numbers={Proportional,OldStyle},RawFeature=+supkern,RawFeature=+calt]{Source Serif Pro}
\usepackage{xpatch}
\usepackage{etoolbox}
\preto{\theendnotes}{%
\renewcommand{\makeenmark}{\textsuperscript{\theenmark}\enspace}%
}
\let\footnote=\endnote
\usepackage{realscripts}
\ExplSyntaxOn
\cs_new_protected:Nn \__realscripts_numtosup:n
{
\str_set:Nn \l_tmpa_str {#1}
\str_map_inline:Nn \l_tmpa_str
{
\str_if_in:nnTF {0123456789} {##1}
{
\int_set:Nn \l_tmpa_int {##1}
\if_case:w \l_tmpa_int ⁰
\or: ¹
\or: ²
\or: ³
\or: ⁴
\or: ⁵
\or: ⁶
\or: ⁷
\or: ⁸
\or: ⁹
\fi:
}
{ { \addfontfeature {VerticalPosition=Superior} ##1 } }
}
}
\cs_generate_variant:Nn \__realscripts_numtosup:n { x }
\DeclareDocumentCommand \realsuperscript { m }
{
\fontspec_if_fontspec_font:TF
{
\fontspec_if_opentype:TF
{
\fontspec_if_feature:nTF { +sups }
{ \__realscripts_numtosup:x {#1} }
{ \fakesuperscript {#1} }
}
{
\fontspec_if_aat_feature:nnTF {10} {1}
{ \__realscripts_numtosup:x {#1} }
{ \fakesuperscript {#1} }
}
}
{ \fakesuperscript {#1} }
}
\ExplSyntaxOff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% BIBLIOGRAPHY
\usepackage[babel]{csquotes}
\usepackage[backend=biber,style=philosophy-verbose,scauthors=all,%
lowscauthors=true,giveninits,classical=true,volnumformat=strings,%
volumeformat=romansc,sorting=nyt,commacit=true,citepages=omit,%
editionformat=superscript,indexing]%
{biblatex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addbibresource{jobname.bib}
\nocite{*}
\begin{document}
Text\footnote{Footnote text} more «text»\footcite[220]{stegmuller:1976}. Further text
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\linespread{0.9}
\theendnotes
\printbibliography[heading=bibintoc]
\end{document}
Does \footcite have a different approach to superscript numbers?
LAST UPDATE
When I try to compile this source:
\begin{filecontents*}{\jobname.bib}
@book{ stegmuller:1976,
author = "Stegmüller, Wolfgang",
title = "The Structure and Dynamics of Theories",
publisher = "Springer",
location = "New-York Heidelberg Berlin",
year = "1976",
edition = "2",
}
\end{filecontents*}
\documentclass{article}
\directlua {
fonts.handlers.otf.addfeature {
name = "supkern",
type = "kern",
data = {
["¹"] = { ["."] = -180,
[","] = -180 },
["²"] = { ["."] = -180,
[","] = -180 },
["³"] = { ["."] = -180,
[","] = -180 },
["⁴"] = { ["."] = -180,
[","] = -180 },
},
}
}
\usepackage{realscripts}
\usepackage[english]{babel}
\usepackage[babel]{csquotes}
\babelfont[english]{rm}[Ligatures=TeX,Language=Default,Numbers={Proportional,OldStyle},RawFeature=+supkern]{Source Serif Pro}
\ExplSyntaxOn
\cs_new_protected:Nn \__realscripts_numtosup:n
{
\str_set:Nn \l_tmpa_str {#1}
\str_map_inline:Nn \l_tmpa_str
{
\str_if_in:nnTF {0123456789} {##1}
{
\int_set:Nn \l_tmpa_int {##1}
\if_case:w \l_tmpa_int ⁰
\or: ¹
\or: ²
\or: ³
\or: ⁴
\or: ⁵
\or: ⁶
\or: ⁷
\or: ⁸
\or: ⁹
\fi:
}
{ { \addfontfeature {VerticalPosition=Superior} ##1 } }
}
}
\cs_generate_variant:Nn \__realscripts_numtosup:n { x }
\DeclareDocumentCommand \realsuperscript { m }
{
\fontspec_if_fontspec_font:TF
{
\fontspec_if_opentype:TF
{
\fontspec_if_feature:nTF { +sups }
{ \__realscripts_numtosup:x {#1} }
{ \fakesuperscript {#1} }
}
{
\fontspec_if_aat_feature:nnTF {10} {1}
{ \__realscripts_numtosup:x {#1} }
{ \fakesuperscript {#1} }
}
}
{ \fakesuperscript {#1} }
}
\ExplSyntaxOff
\usepackage{endnotes}
\usepackage{etoolbox}
\preto{\theendnotes}{%
\renewcommand{\makeenmark}{\textsuperscript{\theenmark}\enspace}%
}
\makeatletter
\def\@makeenmark{\unpenalty{\footnotemarkfont\textsuperscript{\@theenmark}}}
\makeatother
\let\footnote\endnote
\usepackage[style=philosophy-verbose, scauthors=all, lowscauthors=true,
giveninits, classical=true, volnumformat=strings, volumeformat=romansc,
sorting=nyt, commacit=true, citepages=omit, editionformat=superscript,
indexing]{biblatex}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
A\footnote{Footnote text}.
A\footnote{Footnote text},
A\footnote{Footnote text};
A\footcite[53]{stegmuller:1976}.
\theendnotes
\printbibliography
\end{document}
1) first compilation with lualates works fine
2) bibliography compilation with biber works fine
3) new final compilation with lualates produces this error:
! Illegal parameter number in definition of \l__exp_internal_tl.
<to be read again>
1
l.17 {footcite}{}{53}{stegmuller:1976}{}}}
?
I realized that the error comes from edition = "2",in the bibliographical record. That is the very reason for the compilation stops!

biblatex. Your MWE has some errors in it and you haven't included the custom kerning between super scripts and punctuation which is not present in Source Serif Pro. I'll update my answer to show that it works. – David Purton Apr 10 '19 at 01:24\end{filecontents}. – David Purton Apr 10 '19 at 21:54\jobname.bib, rather thanjobname.bib. This makes the temporarybibfile have the same name as thetexfile. – David Purton Apr 11 '19 at 00:38\textsuperscriptis not expandable. It is possible to work around this by slightly redefining the edition field format. But you will run into other problems whenever the argument to\textsuperscriptis unexpandable. – David Purton Apr 11 '19 at 14:23\mkbibsuperscriptis actually a corebiblatexfunction. But this is just one example of what might end up in the argument to\textsuperscriptthat won't work. There could be all kinds of things. – David Purton Apr 12 '19 at 02:19