I read through the SEP article and found that (as usual) there has been terminological confusion in the first place.
A better find from the SEP article on idealism may be:
something mental (the mind, spirit, reason, will) is the ultimate foundation of all reality, or even exhaustive of reality, and
although the existence of something independent of the mind is conceded, everything that we can know about this mind-independent “reality” is held to be so permeated by the creative, formative, or constructive activities of the mind (of some kind or other) that all claims to knowledge must be considered, in some sense, to be a form of self-knowledge.
Idealism in sense (1) may be called “metaphysical” or “ontological idealism”, while idealism in sense (2) may be called “formal” or “epistemological idealism”.
And later on:
If one accepts this characterization, then ontological idealism is meant to be opposed to both dualism, according to which reality ultimately consists not just of mental “stuff” but also of mind-independent matter, and to materialism, which takes matter to be all there is, while epistemological idealism is opposed to materialism but not necessarily to dualism.
Realism as a whole is neatly defined in the article on metaphysical realism:
Metaphysical realism is the thesis that the objects, properties and relations the world contains exist independently of our thoughts about them or our perceptions of them.
In the article on Realism there is a twofold definition, first of what can be considered ontological realism:
First, there is a claim about existence. Tables, rocks, the moon, and so on, all exist, as do the following facts: the table's being square, the rock's being made of granite, and the moon's being spherical and yellow.
And a definition of what might reasonably be called epistemologic realism:
The second aspect of realism about the everyday world of macroscopic objects and their properties concerns independence. The fact that the moon exists and is spherical is independent of anything anyone happens to say or think about the matter. Likewise, although there is a clear sense in which the table's being square is dependent on us (it was designed and constructed by human beings after all), this is not the type of dependence that the realist wishes to deny. The realist wishes to claim that apart from the mundane sort of empirical dependence of objects and their properties familiar to us from everyday life, there is no further (philosophically interesting) sense in which everyday objects and their properties can be said to be dependent on anyone's linguistic practices, conceptual schemes, or whatever.
It has to be considered that there obviously are major glitches between the epistemological/ontological divide in idealism as defined and the respective divide in realism. The SEP article on realism states just before the definitions given:
There are two general aspects to realism, illustrated by looking at realism about the everyday world of macroscopic objects and their properties.
This is supported by the definition of metaphysical realism, which includes both aspects. That means it is implicated that in order to be a "real" (harhar) realist, you have to endorse both aspects, which corresponds to the fact that Kant called himself transcendental idealist, albeit being an ontological realist (highlighted in the article on idealism, too). The ontological idealist on the other side is an idealist in the strongest sense and has by definition have to be epistemological idealist. And an ontological realist does not have to deny the independent existance of thoughts, that would be materialists.
So basically, following these definitions, someone who says that facts exist independent from our thoughts, i.e. we can unalienated by human thought or perception know of them, have to presuppose fact-constituting existance that is mind-independent. Ergo, epistemological realists have to be ontological realists (and only then are full-blooded realists), epistemological idealist can be.