The indented function works by measuring the widths of the prefix (i.e. the number) of the outline entries and taking the maximum of them. The width of the number depends on the font used. The indented function can only get the font of the current context, which is provided by the show rule. Since you only set the font inside the show rule, that information is not available to the indented function, unless you put the link in a separate context block as in
#show outline.entry: it => {
set text(font: "TeX Gyre Heros", fill: blue)
context link(
it.element.location(),
it.indented(it.prefix(), it.inner())
)
}
A more idiomatic way would be to use a show-set rule, as then the context provided by the show rule already contains the correct font:
IIRC, the intended cannot be implemented in Typst, which can explain that it does not obey all Typst rules. IIUC about measuring, it uses context around the whole show rule, so changing styling inside of it is useless. Although I assume putting set text in indented’s arguments would kinda work.
As I said, you can implement it in Typst, but I have to re-read the source code to be sure. If you can, then yeah, you can slap context to it, and it will just work. If that is the case, then there is no point in not having this ability for the built-in one. Although I figure a possible reason is that adding manual context to it for the default show rule would look weird or raise some questions, you don’t normally need context to re-implement default show rules (though not sure how much this is actually true). So yeah, maybe to avoid additional confusion to the already new syntax of utility/building methods on element in show rule.