<commit_before><?xml version="1.0" encoding="utf-8"?>
<mx:Application 
	xmlns:flexlib="http://code.google.com/p/flexlib/"
	xmlns:mx="http://www.adobe.com/2006/mxml" 
	layout="absolute" creationComplete="initApp()">
    <mx:Style>
        
        @font-face{
            src:local("Times New Roman");
            fontFamily:myFont;
            advancedAntiAliasing:true;
            fontWeight:normal;
            fontStyle:normal;
        }
        
        @font-face{
            src:local("Times New Roman");
            fontFamily:myFont;
            advancedAntiAliasing:true;
            fontWeight:bold;
            fontStyle:normal;
        }
        
        @font-face{
            src:local("Times New Roman");
            fontFamily:myFont;
            advancedAntiAliasing:true;
            fontWeight:normal;
            fontStyle:italic;
        }
        
        
        .Document{
            fontFamily:myFont;
            fontSize:14pt;
            paddingLeft:50px;
            paddingRight:50px;
            paddingTop:50px;
            paddingBottom:50px;
        }
    </mx:Style>
    <mx:Script>
        <![CDATA[
            import flexlib.controls.Highlighter;
            import flash.display.BlendMode;
            
            public var highlighter1:Highlighter;
            public var highlighter2:Highlighter;
            
            public var thisTextField:TextField;
            
            public var styles:StyleSheet;
            
            
            public function initApp():void{
                
                this.DataRequest.send();
                
                this.thisTextField = this.getTextField(this.SampleText);
                
                //Sometimes, caching the TextField as a bitmap can improve performance
                //this.thisTextField.cacheAsBitmap = true;
                
                this.highlighter1 = new Highlighter(thisTextField,0xffff0000,50,50);
                this.highlighter2 = new Highlighter(thisTextField,0xff00ff00,50,50);
                
                // Could add filters like this, but it's too processor-intensive right now
                //var myGlow:GlowFilter = new GlowFilter(0xff00ff00,1,10,10,2,1,false,true);
                //this.highlighter2.bitmap.filters = new Array(myGlow);
            }
            
            /*     
                Find the TextField object in the component.
                
                Since textField is protected, we resort to this rather than extend
                every component that has a textField we'd like to highlight. Argh.
            */
            public function getTextField(component:TextArea):TextField{
                var len:int = component.numChildren;
                var r:TextField;
                for(var i:int=0; i<len; i++){
                    var thisChild:DisplayObject = component.getChildAt(i);
                    if(thisChild is TextField){
                        r = thisChild as TextField;
                    }
                }
                return r;
            }
            
            public function getStyles():StyleSheet{
                styles = new StyleSheet();
                
                styles.setStyle("pre",{
                    fontFamily:"myMonospaced",
                    fontSize:8
                });
                
                styles.setStyle("h1",{
                    fontFamily:"myFont",
                    fontSize:18,
                    fontWeight:"bold",
                    textAlign:"center"
                });
                
                styles.setStyle("h2",{
                    fontFamily:"myFont",
                    fontSize:16,
                    fontWeight:"bold"
                });
                
                styles.setStyle("h3",{
                    fontFamily:"myFont",
                    fontSize:14,
                    fontWeight:"bold"
                });
                
                styles.setStyle("p",{
                    fontFamily:"myFont",
                    fontSize:12,
                    textIndent:30
                });
                
                return styles;
            }
            <commit_msg>Remove font reference from Highlighter sample, breaking build portability<commit_after><?xml version="1.0" encoding="utf-8"?>
<mx:Application 
	xmlns:flexlib="http://code.google.com/p/flexlib/"
	xmlns:mx="http://www.adobe.com/2006/mxml" 
	layout="absolute" creationComplete="initApp()">
    <mx:Style>
        .Document{
            fontSize:14pt;
            paddingLeft:50px;
            paddingRight:50px;
            paddingTop:50px;
            paddingBottom:50px;
        }
    </mx:Style>
    <mx:Script>
        <![CDATA[
            import flexlib.controls.Highlighter;
            import flash.display.BlendMode;
            
            public var highlighter1:Highlighter;
            public var highlighter2:Highlighter;
            
            public var thisTextField:TextField;
            
            public var styles:StyleSheet;
            
            
            public function initApp():void{
                
                this.DataRequest.send();
                
                this.thisTextField = this.getTextField(this.SampleText);
                
                //Sometimes, caching the TextField as a bitmap can improve performance
                //this.thisTextField.cacheAsBitmap = true;
                
                this.highlighter1 = new Highlighter(thisTextField,0xffff0000,50,50);
                this.highlighter2 = new Highlighter(thisTextField,0xff00ff00,50,50);
                
                // Could add filters like this, but it's too processor-intensive right now
                //var myGlow:GlowFilter = new GlowFilter(0xff00ff00,1,10,10,2,1,false,true);
                //this.highlighter2.bitmap.filters = new Array(myGlow);
            }
            
            /*     
                Find the TextField object in the component.
                
                Since textField is protected, we resort to this rather than extend
                every component that has a textField we'd like to highlight. Argh.
            */
            public function getTextField(component:TextArea):TextField{
                var len:int = component.numChildren;
                var r:TextField;
                for(var i:int=0; i<len; i++){
                    var thisChild:DisplayObject = component.getChildAt(i);
                    if(thisChild is TextField){
                        r = thisChild as TextField;
                    }
                }
                return r;
            }
            
            public function getStyles():StyleSheet{
                styles = new StyleSheet();
                
                styles.setStyle("pre",{
                    fontFamily:"myMonospaced",
                    fontSize:8
                });
                
                styles.setStyle("h1",{
                    fontSize:18,
                    fontWeight:"bold",
                    textAlign:"center"
                });
                
                styles.setStyle("h2",{
                    fontSize:16,
                    fontWeight:"bold"
                });
                
                styles.setStyle("h3",{
                    fontSize:14,
                    fontWeight:"bold"
                });
                
                styles.setStyle("p",{
                    fontSize:12,
                    textIndent:30
                });
                
                return styles;
            }
            
{'fraction_non_alphanumeric': 0.0849415780491007, 'fraction_numerical': 0.01759222791125115, 'mean_word_length': 1.132101875174923, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 2, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, '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': '4256826', 'n_tokens_mistral': 1948, 'n_tokens_neox': 1786, 'n_words': 343}