If you lose you pay your own and a contribution towards the prosecution costs. For a straightforward trial this would be in the order of �450.
If you win you pay your own.
If you are granted Legal Aid (which is unlikely unless you are virtually destitue and the offence is serious) all your legal costs are met whatever the outcome.
Sorry, I meant to add, that even if you are on Legal Aid, if you are convicted you may still be ordered to pay a contribution towards prosecution costs.