Original question
I downloaded the Cozette font, which includes CozetteVector.ttf and CozetteVector.otf. I copied both of these files to ~/.local/share/fonts and ran fc-cache -v ~/.local/share/fonts. Now when I run fc-list | grep -i cozette, I can see that both the TTF and OTF versions are listed, with the same name, CozetteVector:style=Regular.
When I select the CozetteVector font in a graphical program, which font will be used?
How does Fontconfig handle this situation?
Will having both versions cause problems or create conflicts?
Additional context on why this might occur, and why someone might care
On Fedora 35, font packages often include both OTF and TTF formats of the same font. For example, redhat-text-fonts package includes both /usr/share/fonts/redhat/RedHatText-LightItalic.otf and /usr/share/fonts/redhat/RedHatText-LightItalic.ttf.
I have also encountered a situation where I "installed" a font manually by copying it to ~/.local/share/fonts and running fc-cache -f, but then I later installed the same fonts with a system-provided package. Now I have the same font files, defining the same font families, in two entirely different directories. The filenames might be exactly identical, or there might be some variations.
Usually the duplicates are actually duplicates and the difference doesn't matter. But sometimes these conflicts are nontrivial, e.g. one version is a variable font while another version isn't, or one version includes several stylistic sets while the other version doesn't.