<commit_before>﻿// Copyright (c) p<NAME> Ltd <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Graphics.Textures;
using System.Collections.Generic;
using System.Threading.Tasks;
using osu.Framework.Logging;
using System.Collections.Concurrent;
using JetBrains.Annotations;
using osu.Framework.Platform;
using osu.Framework.Text;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.OpenGL.Textures;
using osuTK.Graphics.ES30;

namespace osu.Framework.IO.Stores
{
    public class FontStore : TextureStore, ITexturedGlyphLookupStore
    {
        private readonly List<GlyphStore> glyphStores = new List<GlyphStore>();

        private readonly List<FontStore> nestedFontStores = new List<FontStore>();

        private Storage cacheStorage;

        /// <summary>
        /// A local cache to avoid string allocation overhead. Can be changed to (string,char)=>string if this ever becomes an issue,
        /// but as long as we directly inherit <see cref="TextureStore"/> this is a slight optimisation.
        /// </summary>
        private readonly ConcurrentDictionary<(string, char), ITexturedCharacterGlyph> namespacedGlyphCache = new ConcurrentDictionary<(string, char), ITexturedCharacterGlyph>();

        public FontStore(IResourceStore<TextureUpload> store = null, float scaleAdjust = 100, All filteringMode = All.Linear)
            : this(store, scaleAdjust, false, filteringMode: filteringMode)<commit_msg>Remove public FontStore filteringMode option Currently it gets overridden by the base font store filtering mode, so we shouldn't have this as an optin for child stores until that gets resolved<commit_after>﻿// Copyright (c) <NAME> <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Graphics.Textures;
using System.Collections.Generic;
using System.Threading.Tasks;
using osu.Framework.Logging;
using System.Collections.Concurrent;
using JetBrains.Annotations;
using osu.Framework.Platform;
using osu.Framework.Text;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.OpenGL.Textures;
using osuTK.Graphics.ES30;

namespace osu.Framework.IO.Stores
{
    public class FontStore : TextureStore, ITexturedGlyphLookupStore
    {
        private readonly List<GlyphStore> glyphStores = new List<GlyphStore>();

        private readonly List<FontStore> nestedFontStores = new List<FontStore>();

        private Storage cacheStorage;

        /// <summary>
        /// A local cache to avoid string allocation overhead. Can be changed to (string,char)=>string if this ever becomes an issue,
        /// but as long as we directly inherit <see cref="TextureStore"/> this is a slight optimisation.
        /// </summary>
        private readonly ConcurrentDictionary<(string, char), ITexturedCharacterGlyph> namespacedGlyphCache = new ConcurrentDictionary<(string, char), ITexturedCharacterGlyph>();

        public FontStore(IResourceStore<TextureUpload> store = null, float scaleAdjust = 100)
            : this(store, scaleAdjust, false)
{'fraction_non_alphanumeric': 0.08904971680302076, 'fraction_numerical': 0.0031466331025802393, 'mean_word_length': 4.254545454545455, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7642511', 'n_tokens_mistral': 864, 'n_tokens_neox': 827, 'n_words': 277}